.objects() .compose(target.getBucket(), target.getName(), request) .setIfMetagenerationMatch(Option.IF_METAGENERATION_MATCH.getLong(targetOptions)) .setIfGenerationMatch(Option.IF_GENERATION_MATCH.getLong(targetOptions)) .setUserProject(Option.USER_PROJECT.getString(targetOptions)) .execute(); } catch (IOException ex) { span.setStatus(Status.UNKNOWN.withDescription(ex.getMessage()));
final Compose compose = storage.compose(destPath.getBucket(), destPath.getObject(), composeRequest); final StorageObject result = compose.execute(); final String combineResult = GcsPath.fromObject(result).toString(); LOG.info("Combine result is " + combineResult);
final Compose compose = storage.compose(destPath.getBucket(), destPath.getObject(), composeRequest); final StorageObject result = compose.execute(); final String combineResult = GcsPath.fromObject(result).toString(); LOG.info("Combine result is " + combineResult);
destination.getBucketName()); compose.setIfGenerationMatch( destination.hasGenerationId() ? destination.getGenerationId() createItemInfoForStorageObject(destination, compose.execute()); logger.atFine().log("composeObjects() done, returning: %s", compositeInfo); return compositeInfo;
.objects() .compose(target.getBucket(), target.getName(), request) .setIfMetagenerationMatch(Option.IF_METAGENERATION_MATCH.getLong(targetOptions)) .setIfGenerationMatch(Option.IF_GENERATION_MATCH.getLong(targetOptions)) .setUserProject(Option.USER_PROJECT.getString(targetOptions)) .execute(); } catch (IOException ex) { span.setStatus(Status.UNKNOWN.withDescription(ex.getMessage()));
@Override public StorageObject compose(Iterable<StorageObject> sources, StorageObject target, Map<Option, ?> targetOptions) { ComposeRequest request = new ComposeRequest(); request.setDestination(target); List<ComposeRequest.SourceObjects> sourceObjects = new ArrayList<>(); for (StorageObject source : sources) { ComposeRequest.SourceObjects sourceObject = new ComposeRequest.SourceObjects(); sourceObject.setName(source.getName()); Long generation = source.getGeneration(); if (generation != null) { sourceObject.setGeneration(generation); sourceObject.setObjectPreconditions( new ObjectPreconditions().setIfGenerationMatch(generation)); } sourceObjects.add(sourceObject); } request.setSourceObjects(sourceObjects); try { return storage.objects() .compose(target.getBucket(), target.getName(), request) .setIfMetagenerationMatch(IF_METAGENERATION_MATCH.getLong(targetOptions)) .setIfGenerationMatch(IF_GENERATION_MATCH.getLong(targetOptions)) .execute(); } catch (IOException ex) { throw translate(ex); } }