<?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 Metadata instanceof DeletedMetadata and FileMetadata in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Metadata-instanceof-DeletedMetadata-and-FileMetadata/m-p/234708#M12829</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to know if there's any way of check if the Metadata of a certain entry is of type DeletedMetadata and FileMetada but not FolderMetadata.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Like the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;if (entry instanceof DeletedMetadata &amp;amp;&amp;amp; entry instanceof FileMetadata) {&lt;BR /&gt;        log.info("Deleted file: "+entry.getPathLower());
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's why I only store files on my application and I don't need to deal with the folders deleted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:20:27 GMT</pubDate>
    <dc:creator>Lechucico</dc:creator>
    <dc:date>2019-05-29T09:20:27Z</dc:date>
    <item>
      <title>Metadata instanceof DeletedMetadata and FileMetadata</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Metadata-instanceof-DeletedMetadata-and-FileMetadata/m-p/234708#M12829</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to know if there's any way of check if the Metadata of a certain entry is of type DeletedMetadata and FileMetada but not FolderMetadata.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Like the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;if (entry instanceof DeletedMetadata &amp;amp;&amp;amp; entry instanceof FileMetadata) {&lt;BR /&gt;        log.info("Deleted file: "+entry.getPathLower());
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's why I only store files on my application and I don't need to deal with the folders deleted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:20:27 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Metadata-instanceof-DeletedMetadata-and-FileMetadata/m-p/234708#M12829</guid>
      <dc:creator>Lechucico</dc:creator>
      <dc:date>2019-05-29T09:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Metadata instanceof DeletedMetadata and FileMetadata</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Metadata-instanceof-DeletedMetadata-and-FileMetadata/m-p/234787#M12837</link>
      <description>&lt;P&gt;Using instanceof is the right way to check the type of a &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; object, &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="_self"&gt;as shown in this example&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/FileMetadata.html" target="_self"&gt;FileMetadata&lt;/A&gt;, &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/DeletedMetadata.html" target="_self"&gt;DeletedMetadata&lt;/A&gt;, and &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/FolderMetadata.html" target="_self"&gt;FolderMetadata&lt;/A&gt; are mutually exclusive though. That is, any given&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&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;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;object can only be one of those three subclasses, but not two of the three. For example, a&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/DeletedMetadata.html" target="_self"&gt;DeletedMetadata&lt;/A&gt;&amp;nbsp;only tells you that it represents a deleted item, and not whether it was a file or folder (or both) previously. That being the case, your "&amp;amp;&amp;amp;" here won't work, as nothing can be both&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/FileMetadata.html" target="_self"&gt;FileMetadata&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/DeletedMetadata.html" target="_self"&gt;DeletedMetadata&lt;/A&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It sounds like you want to know if a particular entry is for a deleted file. The API doesn't exactly support this, as a deleted entry could have been a file or folder or both in the past. That being the case, you can either keep track of what you last saw at that path, in order to check what it was previously, or call &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#listRevisions-java.lang.String-" target="_self"&gt;listRevisions&lt;/A&gt;&amp;nbsp;to see what was previously there.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 15:59:42 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Metadata-instanceof-DeletedMetadata-and-FileMetadata/m-p/234787#M12837</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-07-31T15:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Metadata instanceof DeletedMetadata and FileMetadata</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Metadata-instanceof-DeletedMetadata-and-FileMetadata/m-p/234862#M12851</link>
      <description>&lt;P&gt;I've found a problem. By default, folders doesn't seem to have revision, since if I try to list revisions for a folder an exception raises.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But there's a problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I receive a webhook with a DeleteMetadata I check the list revision of that path for see what was there before, and there's a problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;I create a file 'hello' without extension.&lt;/LI&gt;
&lt;LI&gt;I Remove it.&lt;/LI&gt;
&lt;LI&gt;I create a folder 'hello'&lt;/LI&gt;
&lt;LI&gt;Now if I remove the folder, the revisions of the old file appears.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;When are removed the revisions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've cleaned the bin and revisions still appears from that file.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 09:28:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Metadata-instanceof-DeletedMetadata-and-FileMetadata/m-p/234862#M12851</guid>
      <dc:creator>Lechucico</dc:creator>
      <dc:date>2017-08-01T09:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Metadata instanceof DeletedMetadata and FileMetadata</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Metadata-instanceof-DeletedMetadata-and-FileMetadata/m-p/234897#M12858</link>
      <description>That's correct, folders are not considered to have revisions.&lt;BR /&gt;&lt;BR /&gt;File revisions are stored for 30 days by default, or longer depending on the account type/features: &lt;A href="https://www.dropbox.com/help/space/older-versions" target="_blank"&gt;https://www.dropbox.com/help/space/older-versions&lt;/A&gt;</description>
      <pubDate>Tue, 01 Aug 2017 13:12:59 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Metadata-instanceof-DeletedMetadata-and-FileMetadata/m-p/234897#M12858</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-08-01T13:12:59Z</dc:date>
    </item>
  </channel>
</rss>

