title: Google Drive File ID and Folder ID conventions
body: <p>I am looking to get all files within a folder in Google Drive (given an initial folderId), including all files inside sub-folders. Currently, I am able to retrieve all files in a folder that does not contain any sub-folders, and I am trying to implement the next step of recursively looking through sub-folders and get'ing all the files within.</p>
  
  <p>I'm using <em>drive.children.list</em> on a folderId, and receive an array of <em>drive#childReference</em> objects. Unfortunately, these objects don't directly tell me whether it is a folder or a document, but I've noticed that the folderIds are much shorter than the fileIds.</p>
  
  <p>i.e. The first object below is a folder, and the second object is a file. The folder's id is much shorter than the file, but there is nothing else that helps me distinguish whether each object is a folder or a file.</p>
  
  <pre><code>[ { kind: 'drive#childReference',
         id: '0B2ecLLJU7rP3a2ZmVFZQVDdIRXM',
         selfLink: 'https://www.googleapis.com/drive/v2/files/0B2ecLLJU7rP3YXM0U2tOVm1wcVE/children/0B2ecLLJU7rP3a2ZmVFZQVDdIRXM',
         childLink: 'https://www.googleapis.com/drive/v2/files/0B2ecLLJU7rP3a2ZmVFZQVDdIRXM' },
       { kind: 'drive#childReference',
         id: '178rrwgIQxuoUgphvVYKppTM37PzT1yhzQOr9E1Shpf4',
         selfLink: 'https://www.googleapis.com/drive/v2/files/0B2ecLLJU7rP3YXM0U2tOVm1wcVE/children/178rrwgIQxuoUgphvVYKppTM37PzT1yhzQOr9E1Shpf4',
         childLink: 'https://www.googleapis.com/drive/v2/files/178rrwgIQxuoUgphvVYKppTM37PzT1yhzQOr9E1Shpf4' } ]
  </code></pre>
  
  <p>I'm really hoping that I don't have to make another request for each of the objects to determine whether it is a folder or a file. But I fear that simply determining the length of the ID is too weak. Does anyone have any suggestions? Would it be safe to make a determination based solely on the length of the id?</p>
  
  <p>Thanks!</p>