I am trying to export several files from Google drive using this code:
String str = "application/rft";
OutputStream outputStream = new ByteArrayOutputStream();
driveService.files().export(fileId, str).executeAndDownloadTo(outputStream);
and it works properly but, when I try to export an application/pdf or application/png or application/jpeg file I am getting this error:
403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "global",
"message" : "Export only supports Google Docs.",
"reason" : "fileNotExportable"
} ],
"message" : "Export only supports Google Docs."
}
I would like to know if there is a way to get this file's content using Java
Thanks in advance