<?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: [java sdk v2] check if entry of a listResult is a file in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-sdk-v2-check-if-entry-of-a-listResult-is-a-file/m-p/192682#M8594</link>
    <description>Hi Greg,&lt;BR /&gt;&lt;BR /&gt;This solves my problem indeed.&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;-victor</description>
    <pubDate>Tue, 01 Nov 2016 09:18:44 GMT</pubDate>
    <dc:creator>Victor V.3</dc:creator>
    <dc:date>2016-11-01T09:18:44Z</dc:date>
    <item>
      <title>[java sdk v2] check if entry of a listResult is a file</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-sdk-v2-check-if-entry-of-a-listResult-is-a-file/m-p/192604#M8569</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With Java Sdk V1 I was able to do build a list of my own type of objects based &lt;STRONG&gt;only&lt;/STRONG&gt; on the files I was finding in a dropbox path:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;List&amp;lt;DbxEntry&amp;gt; dbxEntries = dbxClient.searchFileAndFolderNames(path, query);
            for (DbxEntry child : dbxEntries)
            {
                if (child.isFile())
                {
                    StorageFileImpl i = new StorageFileImpl();
                    i.setName(child.name);
                    i.setPath(child.path);
                    i.setCreationDate(child.asFile().lastModified);
                    result.add(i);
                }
            }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to do the same thing with Sdk V2.&lt;/P&gt;&lt;P&gt;I've considered 2 options:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. using &lt;EM&gt;files().searchBuilder&lt;/EM&gt; - but the &lt;EM&gt;query&lt;/EM&gt; param is not helping me at all. I'd like to be able to ignore it or pass empty string as a value for it, but as far as I've tried, that doesn't work..&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;dbxClient&lt;/SPAN&gt;.files().searchBuilder(path&lt;SPAN&gt;, &lt;/SPAN&gt;query).withMode(SearchMode.&lt;SPAN&gt;FILENAME&lt;/SPAN&gt;).start()&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. using &lt;EM&gt;files().listFolderBuilder&lt;/EM&gt;&amp;nbsp;- but I get entries for folders as well, and I can't exclude them although I saw while debugging that each entry has a file / folder .tag&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;dbxClient&lt;/SPAN&gt;.files().listFolderBuilder(path).withRecursive(&lt;SPAN&gt;true&lt;/SPAN&gt;).start()&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;My code would be the following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;listResult.getEntries().stream()&lt;BR /&gt;                    .forEach(entry -&amp;gt; {&lt;BR /&gt;                        &lt;SPAN&gt;// check it is a file&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;                        // ???&lt;BR /&gt;&lt;/SPAN&gt;                        StorageFileImpl i = &lt;SPAN&gt;new &lt;/SPAN&gt;StorageFileImpl()&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;                        i.setName(entry.getName())&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;                        i.setPath(entry.getPathDisplay())&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;//                        i.setCreationDate(entry.notYetAvailable());&lt;BR /&gt;&lt;/SPAN&gt;                        result.add(i)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;                    })&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;How can I keep only the file .tag type entries ?&lt;/P&gt;&lt;P&gt;Or what other options do I have ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;-victor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:28:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-sdk-v2-check-if-entry-of-a-listResult-is-a-file/m-p/192604#M8569</guid>
      <dc:creator>Victor V.3</dc:creator>
      <dc:date>2019-05-29T09:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: [java sdk v2] check if entry of a listResult is a file</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-sdk-v2-check-if-entry-of-a-listResult-is-a-file/m-p/192628#M8578</link>
      <description>Hi Victor, you can use instanceof to determine if a particular entry is a file or folder, as shown here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/core/examples/android/FilesAdapter.java#L82" target="_blank"&gt;https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/core/examples/android/FilesAdapter.java#L82&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps!</description>
      <pubDate>Mon, 31 Oct 2016 18:22:59 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-sdk-v2-check-if-entry-of-a-listResult-is-a-file/m-p/192628#M8578</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-10-31T18:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: [java sdk v2] check if entry of a listResult is a file</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-sdk-v2-check-if-entry-of-a-listResult-is-a-file/m-p/192682#M8594</link>
      <description>Hi Greg,&lt;BR /&gt;&lt;BR /&gt;This solves my problem indeed.&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;-victor</description>
      <pubDate>Tue, 01 Nov 2016 09:18:44 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-sdk-v2-check-if-entry-of-a-listResult-is-a-file/m-p/192682#M8594</guid>
      <dc:creator>Victor V.3</dc:creator>
      <dc:date>2016-11-01T09:18:44Z</dc:date>
    </item>
  </channel>
</rss>

