<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: metadata.rev in API v2? in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/metadata-rev-in-API-v2/m-p/273123#M16235</link>
    <description>&lt;P&gt;What is mPath??&lt;/P&gt;&lt;P&gt;Is it /App_folder_name/filename ??&lt;/P&gt;</description>
    <pubDate>Thu, 19 Apr 2018 10:50:56 GMT</pubDate>
    <dc:creator>VarunRaj</dc:creator>
    <dc:date>2018-04-19T10:50:56Z</dc:date>
    <item>
      <title>metadata.rev in API v2?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/metadata-rev-in-API-v2/m-p/207625#M10180</link>
      <description>&lt;P&gt;Better late than never, I'm trying to migrate my Android app to API v2.&amp;nbsp; Currently, when downloading a file from a user's linked Dropbox account, I first obtain the file revision...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;@Override
protected Boolean doInBackground(Void... params) {
    try {
        // Get Dropbox file revision
        Entry metadata = mDbxApi.metadata(mPath+mFilename, 5, null, true, null);
        String dbxFileRev = metadata.rev;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm struggling to workout how to do this in V2 because it seems I have to somehow use FileMetadata instead.&lt;/P&gt;&lt;PRE&gt;FileMetadata metadata = ?? mPath+mFilename ??
String dbxFileRev = metadata.getRev();&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can guess, I'm a hobby developer and not a pro!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;M.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:25:37 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/metadata-rev-in-API-v2/m-p/207625#M10180</guid>
      <dc:creator>MateusP</dc:creator>
      <dc:date>2019-05-29T09:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: metadata.rev in API v2?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/metadata-rev-in-API-v2/m-p/207652#M10183</link>
      <description>&lt;P&gt;OK so I worked it out and it's really&amp;nbsp;simple - &amp;nbsp;you just cast to FileMetadata...&lt;/P&gt;&lt;PRE&gt;FileMetadata metadata = (FileMetadata) mDbxClient.files().getMetadata(mPath+mFilename);
String dbxFileRev = metadata.getRev();&lt;/PRE&gt;&lt;P&gt;If the file is not found, it'll throw a 'FileNotFoundException'&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 19:51:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/metadata-rev-in-API-v2/m-p/207652#M10183</guid>
      <dc:creator>MateusP</dc:creator>
      <dc:date>2017-02-20T19:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: metadata.rev in API v2?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/metadata-rev-in-API-v2/m-p/207665#M10186</link>
      <description>&lt;P&gt;I'm glad to see you found this already. Yes, some properties are only available on &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v2.1.x/com/dropbox/core/v2/files/FileMetadata.html" target="_self"&gt;FileMetadata&lt;/A&gt;,&amp;nbsp;which is a subclass of &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v2.1.x/com/dropbox/core/v2/files/Metadata.html" target="_self"&gt;Metadata&lt;/A&gt;, so you need to cast objects as necessary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's an example of how you can check for this here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/7ecc15cf0f51d6ae2ba5cdb334aac2c2f3474b87/examples/android/src/main/java/com/dropbox/core/examples/android/FilesAdapter.java#L82" target="_blank"&gt;https://github.com/dropbox/dropbox-sdk-java/blob/7ecc15cf0f51d6ae2ba5cdb334aac2c2f3474b87/examples/android/src/main/java/com/dropbox/core/examples/android/FilesAdapter.java#L82&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 20:41:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/metadata-rev-in-API-v2/m-p/207665#M10186</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-02-20T20:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: metadata.rev in API v2?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/metadata-rev-in-API-v2/m-p/273123#M16235</link>
      <description>&lt;P&gt;What is mPath??&lt;/P&gt;&lt;P&gt;Is it /App_folder_name/filename ??&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 10:50:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/metadata-rev-in-API-v2/m-p/273123#M16235</guid>
      <dc:creator>VarunRaj</dc:creator>
      <dc:date>2018-04-19T10:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: metadata.rev in API v2?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/metadata-rev-in-API-v2/m-p/273138#M16239</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/664285"&gt;@VarunRaj&lt;/a&gt;&amp;nbsp;The &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#getMetadata-java.lang.String-" target="_self"&gt;getMetadata&lt;/A&gt;&amp;nbsp;method takes the path to the file you're looking for as the "path" parameter. In the sample above, the value being passed in is "mPath+mFilename", which would mean that "mPath" is the path to the parent folder that contains the file with name "mFilename", if any.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that if you're using an app with the app folder permission, you should not explicitly pass in the app folder name. You just operate relative to the app folder, so for example, to reference a file "test.txt" direclty in the app folder, you would just pass in "/test.txt".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also get the path from the &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/Metadata.html#pathLower" target="_blank"&gt;pathLower&lt;/A&gt; property on &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/Metadata.html" target="_self"&gt;Metadata&lt;/A&gt; entries, e.g., as returned by &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#listFolder-java.lang.String-" target="_self"&gt;listFolder&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 13:39:02 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/metadata-rev-in-API-v2/m-p/273138#M16239</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-04-19T13:39:02Z</dc:date>
    </item>
  </channel>
</rss>

