use of com.google.api.services.drive.model.File in project local-data-aragopedia by aragonopendata.
the class GoogleDriveAPI method download.
private void download(String path, File file) throws IOException {
if (file.getShared()) {
String downloadUrl = file.getExportLinks().get("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
HttpResponse resp = drive.getRequestFactory().buildGetRequest(new GenericUrl(downloadUrl)).execute();
InputStream input = resp.getContent();
java.io.File f = new java.io.File(path + java.io.File.separator + file.getTitle() + "." + Prop.formatConfig);
FileUtils.copyInputStreamToFile(input, f);
}
}
Aggregations