Class BlobInfo (2.0.0)

public class BlobInfo implements Serializable

BlobInfo contains metadata about a blob. This metadata is gathered by parsing the HTTP headers included in the blob upload. See Also: RFC 1867 for the specification of HTTP file uploads.

Inheritance

java.lang.Object > BlobInfo

Implements

Serializable

Constructors

BlobInfo(BlobKey blobKey, String contentType, Date creation, String filename, long size)

public BlobInfo(BlobKey blobKey, String contentType, Date creation, String filename, long size)
Parameters
NameDescription
blobKeyBlobKey
contentTypeString
creationDate
filenameString
sizelong

BlobInfo(BlobKey blobKey, String contentType, Date creation, String filename, long size, String md5Hash)

public BlobInfo(BlobKey blobKey, String contentType, Date creation, String filename, long size, String md5Hash)
Parameters
NameDescription
blobKeyBlobKey
contentTypeString
creationDate
filenameString
sizelong
md5HashString

BlobInfo(BlobKey blobKey, String contentType, Date creation, String filename, long size, String md5Hash, @Nullable String gsObjectName)

public BlobInfo(BlobKey blobKey, String contentType, Date creation, String filename, long size, String md5Hash, @Nullable String gsObjectName)

Creates a BlobInfo by providing the BlobKey and all associated metadata. This is typically done by the API on the developer's behalf.

Parameters
NameDescription
blobKeyBlobKey

the BlobKey of the Blob.

contentTypeString

the MIME Content-Type provided in the HTTP header during upload of this Blob.

creationDate

the time and date the blob was uploaded.

filenameString

the file included in the Content-Disposition HTTP header during upload of this Blob.

sizelong

the size in bytes of this Blob.

md5HashString

the md5Hash of this Blob.

gsObjectName@org.checkerframework.checker.nullness.qual.Nullable java.lang.String

the object name of this Blob, if it is stored on Google Cloud Storage, null otherwise.

Fields

blobKey

protected final BlobKey blobKey
Field Value
TypeDescription
BlobKey

contentType

protected final String contentType
Field Value
TypeDescription
String

creation

protected final Date creation
Field Value
TypeDescription
Date

filename

protected final String filename
Field Value
TypeDescription
String

gsObjectName

protected final @Nullable String gsObjectName
Field Value
TypeDescription
@org.checkerframework.checker.nullness.qual.Nullable java.lang.String

md5Hash

protected String md5Hash
Field Value
TypeDescription
String

size

protected final long size
Field Value
TypeDescription
long

Methods

equals(@Nullable Object obj)

public boolean equals(@Nullable Object obj)
Parameter
NameDescription
obj@org.checkerframework.checker.nullness.qual.Nullable java.lang.Object
Returns
TypeDescription
boolean
Overrides

getBlobKey()

public BlobKey getBlobKey()

Returns the BlobKey of the Blob this BlobInfo describes.

Returns
TypeDescription
BlobKey

getContentType()

public String getContentType()

Returns the MIME Content-Type provided in the HTTP header during upload of this Blob.

Returns
TypeDescription
String

getCreation()

public Date getCreation()

Returns the time and date the blob was upload.

Returns
TypeDescription
Date

getFilename()

public String getFilename()

Returns the file included in the Content-Disposition HTTP header during upload of this Blob.

Returns
TypeDescription
String

getGsObjectName()

public @Nullable String getGsObjectName()

Returns the object name of this Blob, if it is stored in Google Cloud Storage, in the form /[bucket-name]/[object-name]. Returns null if the Blob is stored in Blobstorage.

Returns
TypeDescription
@org.checkerframework.checker.nullness.qual.Nullable java.lang.String

getMd5Hash()

public String getMd5Hash()

Returns the md5Hash of this Blob.

Returns
TypeDescription
String

getSize()

public long getSize()

Returns the size in bytes of this Blob.

Returns
TypeDescription
long

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

toString()

public String toString()
Returns
TypeDescription
String
Overrides