<?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: Checking the element is file or folder in dropbox api v2 in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Checking-the-element-is-file-or-folder-in-dropbox-api-v2/m-p/240158#M13361</link>
    <description>You can use instanceof to check if the object is a FileMetadata, FolderMetadata, or DeletedMetadata, e.g., as shown here:&lt;BR /&gt;&lt;BR /&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;</description>
    <pubDate>Tue, 05 Sep 2017 16:37:13 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2017-09-05T16:37:13Z</dc:date>
    <item>
      <title>Checking the element is file or folder in dropbox api v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Checking-the-element-is-file-or-folder-in-dropbox-api-v2/m-p/239360#M13344</link>
      <description>&lt;P&gt;After migrating from api v1 to api v2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not able to solve this issue. Here I am&amp;nbsp; checking the element() was file or folder based on that I will add into a list called pickerList , this code uses api v1&lt;BR /&gt;&amp;nbsp;but don't know how to migrate this into api v2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;  DropboxAPI.Entry mEntry = mApi
                            .metadata(dbxPath, 0, null, true, null);

                    List&amp;lt;DropboxAPI.Entry&amp;gt; mEntries = mEntry.contents;
                    int pathLen = dbxPath.length();

                    for (int i = 0; i &amp;lt; list.size(); i++) {

                        if (!displayDirectory) {
                            if (!(list.get(i).isDir)) {

                                String s = list.get(i).path;
                                pickerList.add(s.substring(pathLen));
                            }
                        } else {
                            String s = list.get(i).path;
                            pickerList.add(s.substring(pathLen));
                        }
                    }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Status of mycode :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;                   ListFolderResult result = null;
                    try {
                        result = dbxClient.files().listFolder(dbxPath);
                    } catch (DbxException e) {
                        e.printStackTrace();
                    }
                    List&amp;lt;Metadata&amp;gt; list = null;
                    for (Metadata metadata: result.getEntries()) {

                        System.out.println(metadata.getPathLower());
                 
                    }&lt;/PRE&gt;
&lt;P&gt;//After this I have to add the code for checking the file or folder&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help me.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:19:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Checking-the-element-is-file-or-folder-in-dropbox-api-v2/m-p/239360#M13344</guid>
      <dc:creator>alfazraza</dc:creator>
      <dc:date>2019-05-29T09:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Checking the element is file or folder in dropbox api v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Checking-the-element-is-file-or-folder-in-dropbox-api-v2/m-p/240158#M13361</link>
      <description>You can use instanceof to check if the object is a FileMetadata, FolderMetadata, or DeletedMetadata, e.g., as shown here:&lt;BR /&gt;&lt;BR /&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;</description>
      <pubDate>Tue, 05 Sep 2017 16:37:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Checking-the-element-is-file-or-folder-in-dropbox-api-v2/m-p/240158#M13361</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-09-05T16:37:13Z</dc:date>
    </item>
  </channel>
</rss>

