Google Drive API - Check if file exists by file ID
<p>I could not find a good way to check if the file exists before downloading it.
It seems the API doesnt provide a way to check if the file exists by getting the file by ID.</p>

<p>Basically Im checking if the generated outPutStream size is > 0 to process the file, but I didnt like the solution.</p>

<pre><code>Drive driveService = new Drive.Builder(buildHttpTransport(), JSON_FACTORY, googleCredential).build();

ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try {
  driveService.files().get(this.fileId).executeMediaAndDownloadTo(outputStream);

  if(outputStream.size() == 0)
   processFile()
</code></pre>

<p>Ideas are welcome!</p>