コンソールへ移動

StorageReference

public class StorageReference extends Object
implements Comparable<StorageReference>

Represents a reference to a Google Cloud Storage object. Developers can upload and download objects, get/set object metadata, and delete an object at a specified path. (see Google Cloud Storage)

Public Method Summary

StorageReference
child(String pathString)
Returns a new instance of StorageReference pointing to a child location of the current reference.
int
Task<Void>
delete()
Deletes the object at this StorageReference.
boolean
equals(Object other)
List<FileDownloadTask>
List<UploadTask>
String
getBucket()
Return the Google Cloud Storage bucket that holds this object.
Task<byte[]>
getBytes(long maxDownloadSizeBytes)
Asynchronously downloads the object from this StorageReference A byte array will be allocated large enough to hold the entire file in memory.
Task<Uri>
getDownloadUrl()
Asynchronously retrieves a long lived download URL with a revokable token.
FileDownloadTask
getFile(File destinationFile)
Asynchronously downloads the object at this StorageReference to a specified system filepath.
FileDownloadTask
getFile(Uri destinationUri)
Asynchronously downloads the object at this StorageReference to a specified system filepath.
Task<StorageMetadata>
getMetadata()
Retrieves metadata associated with an object at this StorageReference.
String
getName()
Returns the short name of this object.
StorageReference
getParent()
Returns a new instance of StorageReference pointing to the parent location or null if this instance references the root location.
String
getPath()
Returns the full path to this object, not including the Google Cloud Storage bucket.
StorageReference
getRoot()
Returns a new instance of StorageReference pointing to the root location.
FirebaseStorage
getStorage()
Returns the FirebaseStorage service which created this reference.
StreamDownloadTask
getStream(StreamDownloadTask.StreamProcessor processor)
Asynchronously downloads the object at this StorageReference via a InputStream.
StreamDownloadTask
getStream()
Asynchronously downloads the object at this StorageReference via a InputStream.
int
Task<ListResult>
list(int maxResults, String pageToken)
Resumes a previous call to list(int), starting after a pagination token.
Task<ListResult>
list(int maxResults)
List up to maxResults items (files) and prefixes (folders) under this StorageReference.
Task<ListResult>
listAll()
List all items (files) and prefixes (folders) under this StorageReference.
UploadTask
putBytes(byte[] bytes, StorageMetadata metadata)
Asynchronously uploads byte data to this StorageReference.
UploadTask
putBytes(byte[] bytes)
Asynchronously uploads byte data to this StorageReference.
UploadTask
putFile(Uri uri, StorageMetadata metadata, Uri existingUploadUri)
Asynchronously uploads from a content URI to this StorageReference.
UploadTask
putFile(Uri uri, StorageMetadata metadata)
Asynchronously uploads from a content URI to this StorageReference.
UploadTask
putFile(Uri uri)
Asynchronously uploads from a content URI to this StorageReference.
UploadTask
putStream(InputStream stream, StorageMetadata metadata)
Asynchronously uploads a stream of data to this StorageReference.
UploadTask
putStream(InputStream stream)
Asynchronously uploads a stream of data to this StorageReference.
String
Task<StorageMetadata>
updateMetadata(StorageMetadata metadata)
Updates the metadata associated with this StorageReference.

Inherited Method Summary