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"); } }
optionMap( composeRequest.getTarget().getGeneration(), composeRequest.getTarget().getMetageneration(), composeRequest.getTargetOptions()); try {
optionMap( copyRequest.getTarget().getGeneration(), copyRequest.getTarget().getMetageneration(), copyRequest.getTargetOptions()); try {
assertEquals(expected.getMediaLink(), value.getMediaLink()); assertEquals(expected.getMetadata(), value.getMetadata()); assertEquals(expected.getMetageneration(), value.getMetageneration()); assertEquals(expected.getOwner(), value.getOwner()); assertEquals(expected.getSelfLink(), value.getSelfLink());
assertEquals(MEDIA_LINK, BLOB_INFO.getMediaLink()); assertEquals(METADATA, BLOB_INFO.getMetadata()); assertEquals(META_GENERATION, BLOB_INFO.getMetageneration()); assertEquals(OWNER, BLOB_INFO.getOwner()); assertEquals(SELF_LINK, BLOB_INFO.getSelfLink()); assertNull(DIRECTORY_INFO.getMediaLink()); assertNull(DIRECTORY_INFO.getMetadata()); assertNull(DIRECTORY_INFO.getMetageneration()); assertNull(DIRECTORY_INFO.getOwner()); assertNull(DIRECTORY_INFO.getSelfLink());
assertNull(blobInfo.getMediaLink()); assertNull(blobInfo.getMetadata()); assertNull(blobInfo.getMetageneration()); assertNull(blobInfo.getOwner()); assertNull(blobInfo.getSelfLink());
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"); } }
optionMap( composeRequest.getTarget().getGeneration(), composeRequest.getTarget().getMetageneration(), composeRequest.getTargetOptions()); try {
optionMap( copyRequest.getTarget().getGeneration(), copyRequest.getTarget().getMetageneration(), copyRequest.getTargetOptions()); try {