[SalesForce] How to extract the application brand logo image over an API

In API 38 (Winter '17), when an "App Branding" image is uploaded through the Lightning Experience UI, the app metadata includes this brand information:

<?xml version="1.0" encoding="UTF-8"?>
<CustomApplication xmlns="http://soap.sforce.com/2006/04/metadata">
    <brand>
        <headerColor>#AF2524</headerColor>
        <logo>CV_CF_Icon_128</logo>
        <logoVersion>1</logoVersion>
    </brand>
    ...

The CustomApplication documentation says that the logo is:

The optional reference to the image document for the application.

But I don't see a Document with a matching name.

Where is this logo image stored, and how can I extract it via the metadata so I can add it to version control and have a working continuous integration deployment from that version control copy?

PS

Used "Search Salesforce" and found it presented as a "File" (a ContentDocument). Is there a good way to get this into version control?

Best Answer

When I checked in the app, the Ant deploy error was:

In field: logo - no ContentAsset named CV_CF_Icon_128 found

which a quick Google then revealed this new type name to be added to package.xml:

<types>
    <members>CV_CF_Icon_128</members>
    <name>ContentAsset</name>
</types>

that resulted in a folder called contentassets in the project with a CV_CF_Icon_128.asset file and a corresponding meta file of:

<?xml version="1.0" encoding="UTF-8"?>
<ContentAsset xmlns="http://soap.sforce.com/2006/04/metadata">
    <language>en_US</language>
    <masterLabel>CV_CF_Icon_128</masterLabel>
    <relationships>
        <organization>
            <access>VIEWER</access>
        </organization>
    </relationships>
    <versions>
        <version>
            <number>1</number>
            <pathOnClient>CV_CF_Icon_128.png</pathOnClient>
        </version>
    </versions>
</ContentAsset>

This deployed correctly in the next build.