public class BucketSnippets extends Object
Bucket class.| Constructor and Description |
|---|
BucketSnippets(com.google.cloud.storage.Bucket bucket) |
| Modifier and Type | Method and Description |
|---|---|
com.google.cloud.storage.Blob |
createBlobFromByteArray(String blobName)
Example of creating a blob in the bucket from a byte array.
|
com.google.cloud.storage.Blob |
createBlobFromByteArrayWithContentType(String blobName)
Example of creating a blob in the bucket from a byte array with a content type.
|
com.google.cloud.storage.Blob |
createBlobFromInputStream(String blobName)
Example of creating a blob in the bucket from an input stream.
|
com.google.cloud.storage.Blob |
createBlobFromInputStreamWithContentType(String blobName)
Example of creating a blob in the bucket from an input stream with a content type.
|
boolean |
delete()
Example of deleting the bucket, if its metageneration matches the
BucketInfo.metageneration() value, otherwise a StorageException is thrown. |
boolean |
exists()
Example of checking if the bucket exists.
|
com.google.cloud.storage.Blob |
getBlob(String blobName,
long generation)
Example of getting a blob in the bucket, only if its metageneration matches a value, otherwise
a
StorageException is thrown. |
List<com.google.cloud.storage.Blob> |
getBlobFromStringIterable(String blobName1,
String blobName2)
Example of getting some blobs in the bucket, using a batch request.
|
List<com.google.cloud.storage.Blob> |
getBlobFromStrings(String blobName1,
String blobName2)
Example of getting some blobs in the bucket, using a batch request.
|
Iterator<com.google.cloud.storage.Blob> |
listBlobs()
Example of listing the blobs in the bucket.
|
com.google.cloud.storage.Bucket |
reload()
Example of getting the bucket's latest information, if its generation does not match the
BucketInfo.metageneration() value, otherwise a StorageException is thrown. |
com.google.cloud.storage.Bucket |
update()
Example of updating the bucket's information.
|
public boolean exists()
public com.google.cloud.storage.Bucket reload()
BucketInfo.metageneration() value, otherwise a StorageException is thrown.public com.google.cloud.storage.Bucket update()
public boolean delete()
BucketInfo.metageneration() value, otherwise a StorageException is thrown.public Iterator<com.google.cloud.storage.Blob> listBlobs()
public com.google.cloud.storage.Blob getBlob(String blobName, long generation)
StorageException is thrown.public List<com.google.cloud.storage.Blob> getBlobFromStrings(String blobName1, String blobName2)
public List<com.google.cloud.storage.Blob> getBlobFromStringIterable(String blobName1, String blobName2)
public com.google.cloud.storage.Blob createBlobFromByteArray(String blobName)
public com.google.cloud.storage.Blob createBlobFromInputStream(String blobName)
public com.google.cloud.storage.Blob createBlobFromByteArrayWithContentType(String blobName)
public com.google.cloud.storage.Blob createBlobFromInputStreamWithContentType(String blobName)
Copyright © 2016 Google. All rights reserved.