@Override public String toString() { return MoreObjects.toStringHelper(this) .add("bucket", getBucket()) .add("name", getName()) .add("generation", getGeneration()) .add("size", getSize()) .add("content-type", getContentType()) .add("metadata", getMetadata()) .toString(); }
static Map<StorageRpc.Option, ?> optionMap(BlobInfo blobInfo, Option... options) { return optionMap(blobInfo.getGeneration(), blobInfo.getMetageneration(), options); }
private Storage.BlobGetOption toGetOption(BlobInfo blobInfo) { switch (getRpcOption()) { case IF_GENERATION_MATCH: return Storage.BlobGetOption.generationMatch(blobInfo.getGeneration()); case IF_GENERATION_NOT_MATCH: return Storage.BlobGetOption.generationNotMatch(blobInfo.getGeneration()); case IF_METAGENERATION_MATCH: return Storage.BlobGetOption.metagenerationMatch(blobInfo.getMetageneration()); case IF_METAGENERATION_NOT_MATCH: return Storage.BlobGetOption.metagenerationNotMatch(blobInfo.getMetageneration()); case USER_PROJECT: return Storage.BlobGetOption.userProject((String) getValue()); default: throw new AssertionError("Unexpected enum value"); } }
private Storage.BlobSourceOption toSourceOptions(BlobInfo blobInfo) { switch (getRpcOption()) { case IF_GENERATION_MATCH: return Storage.BlobSourceOption.generationMatch(blobInfo.getGeneration()); case IF_GENERATION_NOT_MATCH: return Storage.BlobSourceOption.generationNotMatch(blobInfo.getGeneration()); case IF_METAGENERATION_MATCH: return Storage.BlobSourceOption.metagenerationMatch(blobInfo.getMetageneration()); case IF_METAGENERATION_NOT_MATCH: return Storage.BlobSourceOption.metagenerationNotMatch(blobInfo.getMetageneration()); case CUSTOMER_SUPPLIED_KEY: return Storage.BlobSourceOption.decryptionKey((String) getValue()); case USER_PROJECT: return Storage.BlobSourceOption.userProject((String) getValue()); default: throw new AssertionError("Unexpected enum value"); } }
String.format("gs://%s/%s", file.getBucket(), file.getName())); this.generation = blobInfo.getGeneration(); this.size = blobInfo.getSize(); return this.size;
final Map<StorageRpc.Option, ?> targetOptions = optionMap( composeRequest.getTarget().getGeneration(), composeRequest.getTarget().getMetageneration(), composeRequest.getTargetOptions());
final Map<StorageRpc.Option, ?> targetOptions = optionMap( copyRequest.getTarget().getGeneration(), copyRequest.getTarget().getMetageneration(), copyRequest.getTargetOptions());
assertEquals(expected.getDeleteTime(), value.getDeleteTime()); assertEquals(expected.getEtag(), value.getEtag()); assertEquals(expected.getGeneration(), value.getGeneration()); assertEquals(expected.getGeneratedId(), value.getGeneratedId()); assertEquals(expected.getMd5(), value.getMd5());
assertEquals(DELETE_TIME, BLOB_INFO.getDeleteTime()); assertEquals(ETAG, BLOB_INFO.getEtag()); assertEquals(GENERATION, BLOB_INFO.getGeneration()); assertEquals(GENERATED_ID, BLOB_INFO.getGeneratedId()); assertEquals(MD5, BLOB_INFO.getMd5()); assertNull(DIRECTORY_INFO.getDeleteTime()); assertNull(DIRECTORY_INFO.getEtag()); assertNull(DIRECTORY_INFO.getGeneration()); assertNull(DIRECTORY_INFO.getGeneratedId()); assertNull(DIRECTORY_INFO.getMd5());
assertNull(blobInfo.getDeleteTime()); assertNull(blobInfo.getEtag()); assertNull(blobInfo.getGeneration()); assertNull(blobInfo.getGeneratedId()); assertNull(blobInfo.getMd5());
@Override public String toString() { return MoreObjects.toStringHelper(this) .add("bucket", getBucket()) .add("name", getName()) .add("generation", getGeneration()) .add("size", getSize()) .add("content-type", getContentType()) .add("metadata", getMetadata()) .toString(); }
static Map<StorageRpc.Option, ?> optionMap(BlobInfo blobInfo, Option... options) { return optionMap(blobInfo.getGeneration(), blobInfo.getMetageneration(), options); }
private Storage.BlobGetOption toGetOption(BlobInfo blobInfo) { switch (getRpcOption()) { case IF_GENERATION_MATCH: return Storage.BlobGetOption.generationMatch(blobInfo.getGeneration()); case IF_GENERATION_NOT_MATCH: return Storage.BlobGetOption.generationNotMatch(blobInfo.getGeneration()); case IF_METAGENERATION_MATCH: return Storage.BlobGetOption.metagenerationMatch(blobInfo.getMetageneration()); case IF_METAGENERATION_NOT_MATCH: return Storage.BlobGetOption.metagenerationNotMatch(blobInfo.getMetageneration()); case USER_PROJECT: return Storage.BlobGetOption.userProject((String) getValue()); default: throw new AssertionError("Unexpected enum value"); } }
private Storage.BlobSourceOption toSourceOptions(BlobInfo blobInfo) { switch (getRpcOption()) { case IF_GENERATION_MATCH: return Storage.BlobSourceOption.generationMatch(blobInfo.getGeneration()); case IF_GENERATION_NOT_MATCH: return Storage.BlobSourceOption.generationNotMatch(blobInfo.getGeneration()); case IF_METAGENERATION_MATCH: return Storage.BlobSourceOption.metagenerationMatch(blobInfo.getMetageneration()); case IF_METAGENERATION_NOT_MATCH: return Storage.BlobSourceOption.metagenerationNotMatch(blobInfo.getMetageneration()); case CUSTOMER_SUPPLIED_KEY: return Storage.BlobSourceOption.decryptionKey((String) getValue()); case USER_PROJECT: return Storage.BlobSourceOption.userProject((String) getValue()); default: throw new AssertionError("Unexpected enum value"); } }
final Map<StorageRpc.Option, ?> targetOptions = optionMap( composeRequest.getTarget().getGeneration(), composeRequest.getTarget().getMetageneration(), composeRequest.getTargetOptions());
final Map<StorageRpc.Option, ?> targetOptions = optionMap( copyRequest.getTarget().getGeneration(), copyRequest.getTarget().getMetageneration(), copyRequest.getTargetOptions());