/** Returns blob's data generation. Used for blob versioning. */ public Long getGeneration() { return getBlobId().getGeneration(); }
static Map<StorageRpc.Option, ?> optionMap(BlobId blobId, Option... options) { return optionMap(blobId.getGeneration(), null, options); } }
@Override public String toString() { return MoreObjects.toStringHelper(this) .add("bucket", getBucket()) .add("name", getName()) .add("generation", getGeneration()) .toString(); }
@Override public Object fileKey() { return info.getBlobId().getBucket() + info.getBlobId().getName() + info.getBlobId().getGeneration(); }
@Override public List<Acl> listAcls(final BlobId blob) { try { List<ObjectAccessControl> answer = runWithRetries( new Callable<List<ObjectAccessControl>>() { @Override public List<ObjectAccessControl> call() { return storageRpc.listAcls( blob.getBucket(), blob.getName(), blob.getGeneration()); } }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); return Lists.transform(answer, Acl.FROM_OBJECT_PB_FUNCTION); } catch (RetryHelperException e) { throw StorageException.translateAndThrow(e); } }
@Override public Acl createAcl(final BlobId blob, final Acl acl) { final ObjectAccessControl aclPb = acl.toObjectPb() .setBucket(blob.getBucket()) .setObject(blob.getName()) .setGeneration(blob.getGeneration()); try { return Acl.fromPb( runWithRetries( new Callable<ObjectAccessControl>() { @Override public ObjectAccessControl call() { return storageRpc.createAcl(aclPb); } }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock())); } catch (RetryHelperException e) { throw StorageException.translateAndThrow(e); } }
@Override public Acl updateAcl(BlobId blob, Acl acl) { final ObjectAccessControl aclPb = acl.toObjectPb() .setBucket(blob.getBucket()) .setObject(blob.getName()) .setGeneration(blob.getGeneration()); try { return Acl.fromPb( runWithRetries( new Callable<ObjectAccessControl>() { @Override public ObjectAccessControl call() { return storageRpc.patchAcl(aclPb); } }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock())); } catch (RetryHelperException e) { throw StorageException.translateAndThrow(e); } }
final Map<StorageRpc.Option, ?> sourceOptions = optionMap( copyRequest.getSource().getGeneration(), null, copyRequest.getSourceOptions(), true); final StorageObject targetObject = copyRequest.getTarget().toPb(); final Map<StorageRpc.Option, ?> targetOptions =
static Map<StorageRpc.Option, ?> optionMap(BlobId blobId, Option... options) { return optionMap(blobId.getGeneration(), null, options); } }
/** Returns blob's data generation. Used for blob versioning. */ public Long getGeneration() { return getBlobId().getGeneration(); }
@Override public String toString() { return MoreObjects.toStringHelper(this) .add("bucket", getBucket()) .add("name", getName()) .add("generation", getGeneration()) .toString(); }
@Override public Object fileKey() { return info.getBlobId().getBucket() + info.getBlobId().getName() + info.getBlobId().getGeneration(); }
@Override public List<Acl> listAcls(final BlobId blob) { try { List<ObjectAccessControl> answer = runWithRetries( new Callable<List<ObjectAccessControl>>() { @Override public List<ObjectAccessControl> call() { return storageRpc.listAcls( blob.getBucket(), blob.getName(), blob.getGeneration()); } }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); return Lists.transform(answer, Acl.FROM_OBJECT_PB_FUNCTION); } catch (RetryHelperException e) { throw StorageException.translateAndThrow(e); } }
@Override public Acl updateAcl(BlobId blob, Acl acl) { final ObjectAccessControl aclPb = acl.toObjectPb() .setBucket(blob.getBucket()) .setObject(blob.getName()) .setGeneration(blob.getGeneration()); try { return Acl.fromPb( runWithRetries( new Callable<ObjectAccessControl>() { @Override public ObjectAccessControl call() { return storageRpc.patchAcl(aclPb); } }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock())); } catch (RetryHelperException e) { throw StorageException.translateAndThrow(e); } }
@Override public Acl createAcl(final BlobId blob, final Acl acl) { final ObjectAccessControl aclPb = acl.toObjectPb() .setBucket(blob.getBucket()) .setObject(blob.getName()) .setGeneration(blob.getGeneration()); try { return Acl.fromPb( runWithRetries( new Callable<ObjectAccessControl>() { @Override public ObjectAccessControl call() { return storageRpc.createAcl(aclPb); } }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock())); } catch (RetryHelperException e) { throw StorageException.translateAndThrow(e); } }
final Map<StorageRpc.Option, ?> sourceOptions = optionMap( copyRequest.getSource().getGeneration(), null, copyRequest.getSourceOptions(), true); final StorageObject targetObject = copyRequest.getTarget().toPb(); final Map<StorageRpc.Option, ?> targetOptions =