I am using Google documents api.
DocsService service = new DocsService(APP_NAME);
service.query(qry, DocumentListFeed.class);
List<DocumentListEntry> docEntries = docFeed.getEntries();
for(DocumentListEntry entry : docEntries)
{
System.out.println(entry.getQuotaBytesUsed());
}
I am using the above code to get size of the document.
If I upload a document to Google, I am getting the size.
If I create a document/spreadsheet/drawing/presentation/form, I am getting zero as size.
I need solution for the below questions.
1. How to get proper file size of the created Google documents
2. How to differentiate spreadsheet and form.? Both I am getting entry.getType() as spreadsheet.
Please any one help me.
Thanks in advance.
1) Google Documents do not use any storage quota on the user’s account therefore the reported size will always be zero
2) The Documents List API will will include the element
<docs:hasForm value='true'/>in the xml response when requesting a form, however, that value is not exposed by the Java client library. You should update to the newer Drive API and then check the MIME type of the item, which will beapplication/vnd.google-apps.formfor a form andapplication/vnd.google-apps.spreadsheetfor a spreadsheet.