@Override public Map<String, Object> getReturnValues() { Map<String, Object> r = result.toMap(); r.put(GoogleDrivePutDefinition.RETURN_FILE_ID, sentFile.getId()); r.put(GoogleDrivePutDefinition.RETURN_PARENT_FOLDER_ID, sentFile.getParents().get(0)); return r; }
@Override public Map<String, Object> getReturnValues() { Map<String, Object> r = result.toMap(); r.put(GoogleDrivePutDefinition.RETURN_FILE_ID, sentFile.getId()); r.put(GoogleDrivePutDefinition.RETURN_PARENT_FOLDER_ID, sentFile.getParents().get(0)); return r; }
private void setReturnValues(RuntimeContainer container) { String componentId = container.getCurrentComponentId(); container.setComponentData(componentId, getStudioName(GoogleDrivePutDefinition.RETURN_PARENT_FOLDER_ID), sentFile.getParents().get(0)); container.setComponentData(componentId, getStudioName(GoogleDrivePutDefinition.RETURN_FILE_ID), sentFile.getId()); } }
private void setReturnValues(RuntimeContainer container) { String componentId = container.getCurrentComponentId(); container.setComponentData(componentId, getStudioName(GoogleDrivePutDefinition.RETURN_PARENT_FOLDER_ID), sentFile.getParents().get(0)); container.setComponentData(componentId, getStudioName(GoogleDrivePutDefinition.RETURN_FILE_ID), sentFile.getId()); } }
record.put(0, bytes); record.put(1, sentFile.getParents().get(0)); record.put(2, sentFile.getId()); cleanWrites();
record.put(0, bytes); record.put(1, sentFile.getParents().get(0)); record.put(2, sentFile.getId()); cleanWrites();
@Override public boolean start() throws IOException { super.start(); String localFilePath = properties.localFilePath.getValue(); String destinationFolderId = properties.destinationFolderAccessMethod.getValue().equals(AccessMethod.Id) ? properties.destinationFolder.getValue() : utils.getFolderId(properties.destinationFolder.getValue(), false); GoogleDrivePutParameters p = new GoogleDrivePutParameters(destinationFolderId, properties.fileName.getValue(), properties.overwrite.getValue(), localFilePath); sentFile = utils.putResource(p); record = new Record(properties.schemaMain.schema.getValue()); record.put(0, java.nio.file.Files.readAllBytes(Paths.get(localFilePath))); record.put(1, sentFile.getParents().get(0)); record.put(2, sentFile.getId()); result.totalCount++; result.successCount++; return true; }
@Override public boolean start() throws IOException { super.start(); String localFilePath = properties.localFilePath.getValue(); String destinationFolderId = properties.destinationFolderAccessMethod.getValue().equals(AccessMethod.Id) ? properties.destinationFolder.getValue() : utils.getFolderId(properties.destinationFolder.getValue(), false); GoogleDrivePutParameters p = new GoogleDrivePutParameters(destinationFolderId, properties.fileName.getValue(), properties.overwrite.getValue(), localFilePath); sentFile = utils.putResource(p); record = new Record(properties.schemaMain.schema.getValue()); record.put(0, java.nio.file.Files.readAllBytes(Paths.get(localFilePath))); record.put(1, sentFile.getParents().get(0)); record.put(2, sentFile.getId()); result.totalCount++; result.successCount++; return true; }
private GFile create(File file) { GFile newFile = new GFile(file.getName() != null ? file.getName() : file.getOriginalFilename()); newFile.setId(file.getId()); newFile.setLastModified(file.getModifiedTime() != null ? file.getModifiedTime().getValue() : 0); newFile.setDirectory(GFile.MIME_TYPE.GOOGLE_FOLDER.getValue().equals(file.getMimeType())); newFile.setSize(file.getSize() != null ? file.getSize() : 0); // null for directories newFile.setMimeType(file.getMimeType()); newFile.setMd5Checksum(file.getMd5Checksum()); if (file.getParents() != null) { Set<String> newParents = new HashSet<>(); for (String newParent : file.getParents()) { newParents.add(newParent.equals(ROOT_FOLDER_ID) ? "root" : newParent); } newFile.setParents(newParents); } else { // does this happen? newFile.setParents(Collections.singleton("root")); } newFile.setTrashed(file.getTrashed() != null && file.getTrashed()); return newFile; }
private IndexedRecord convertSearchResultToIndexedRecord(File file) { // Main record IndexedRecord main = new GenericData.Record(schema); main.put(0, file.getId()); main.put(1, file.getName()); main.put(2, file.getMimeType()); main.put(3, file.getModifiedTime().getValue()); main.put(4, file.getSize()); main.put(5, file.getKind()); main.put(6, file.getTrashed()); main.put(7, file.getParents().toString()); // TODO This should be a List<String> main.put(8, file.getWebViewLink()); return main; }
private IndexedRecord convertSearchResultToIndexedRecord(File file) { // Main record IndexedRecord main = new GenericData.Record(schema); main.put(0, file.getId()); main.put(1, file.getName()); main.put(2, file.getMimeType()); main.put(3, file.getModifiedTime().getValue()); main.put(4, file.getSize()); main.put(5, file.getKind()); main.put(6, file.getTrashed()); main.put(7, file.getParents().toString()); // TODO This should be a List<String> main.put(8, file.getWebViewLink()); return main; }
.setSupportsTeamDrives(PreferencesFactory.get().getBoolean("googledrive.teamdrive.enable")) .execute(); for(String parent : reference.getParents()) { previousParents.append(parent); previousParents.append(',');