// copyOfdriveItem.setTitle(driveItem.getTitle());
// copyOfdriveItem.setMimeType(driveItem.getMimeType());
// copyOfdriveItem.setProperties(driveItem.getProperties());
final File _copyOfDriveItem = service.files().copy(item.getRemoteIdentifier(), copyOfdriveItem).execute();
if (_copyOfDriveItem == null) {
throw new CloudsyncException("Could not make a history snapshot of item '" + item.getPath() + "'");
}
}
}
File driveItem = new File();
final byte[] data = _prepareDriveItem(driveItem, item, handler, with_filedata);
if (data == null) {
driveItem = service.files().update(item.getRemoteIdentifier(), driveItem).execute();
} else {
final InputStreamContent params = new InputStreamContent(FILE, new ByteArrayInputStream(data));
params.setLength(data.length);
Update updater = service.files().update(item.getRemoteIdentifier(), driveItem, params);
MediaHttpUploader uploader = updater.getMediaHttpUploader();
prepareUploader(uploader, data);
driveItem = updater.execute();
}
if (driveItem == null) {
throw new CloudsyncException("Could not update item '" + item.getPath() + "'");
} else if (driveItem.getLabels().getTrashed()) {
throw new CloudsyncException("Remote item '" + item.getPath() + "' [" + driveItem.getId() + "] is trashed\ntry to run with --nocache");
}
_addToCache(driveItem, null);
return;
} catch (final NoSuchFileException e) {
throw e;