--I can create files on Google Drive and the language is automatically set for me while using drive.google.com.But I am having issues while creating files using Google Drive API via my application.(google-api-services-drive-v2-rev192-1.20.0.jar)The default language of the document is not set.This is causing issues with the voice typing being grayed out.Here is how I createFile in my application:
public static File createFile(Car car) {
System.out.println("CREATING FILE");
try {
File body = new File();
body.setTitle("Document for " + car.getCar_name()
+ ".docx");
body.setMimeType(GOOGLE_DOCOCUMENT_MIME_TYPE);
body.setEditable(true);
Permission ownership = getOwnerShipPermission();
Permission unlockedFile = getUnlockedFilePermission();
java.io.File fileContent = null;
fileContent = CarServiceReportTemplateFactory.createCarServiceReportTemplateFile(car);
FileContent mediaContent = new FileContent(MS_WORD_DOCUMENT_MIME_TYPE, fileContent);
File file = driveservice.files().insert(body, mediaContent).execute();
String fildid = file.getId();
driveservice.permissions().insert(fildid, unlockedFile).execute();
fileContent.delete();
return file;
} catch (IOException ex) {
ex.printStackTrace();
return null;
}
}I did have a look at the drive api file category but I cannot find anything related to setting default language.
I would much appreciate if you know a workaround this problem.
Thank you.
You received this message because you are subscribed to the Google Groups "google-api-java-client" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-api-java-client+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I did ask on StackOverflow but noone has got back to me yet.So I am trying here.What do you mean by google-drive-sdk tag?