Class FileInfo (2.0.0)

public class FileInfo

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

Inheritance

java.lang.Object > FileInfo

Constructors

FileInfo(String contentType, Date creation, String filename, long size, String md5Hash, @Nullable String gsObjectName)

public FileInfo(String contentType, Date creation, String filename, long size, String md5Hash, @Nullable String gsObjectName)

Creates a FileInfo by providing the associated metadata. This is done by the API on the developer's behalf.

Parameters
Name Description
contentType String

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

creation Date

the time and date the blob was uploaded.

filename String

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

size long

the size in bytes of this Blob.

md5Hash String

the md5Hash of this Blob.

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

the name of the file written to Google Cloud Storage or null if the file was not uploaded to Google Cloud Storage.

Methods

equals(@Nullable Object obj)

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

getContentType()

public String getContentType()

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

Returns
Type Description
String

getCreation()

public Date getCreation()

Returns the time and date the blob was upload.

Returns
Type Description
Date

getFilename()

public String getFilename()

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

Returns
Type Description
String

getGsObjectName()

public @Nullable String getGsObjectName()

Returns the name of the file written to Google Cloud Storage or null if the file was not uploaded to Google Cloud Storage. This property is only available for BlobInfos returned by getUploadedBlobInfos(), as its value is not persisted in the Datastore. Any attempt to access this property on other BlobInfos will return null.

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

getMd5Hash()

public String getMd5Hash()

Returns the md5Hash of this Blob.

Returns
Type Description
String

getSize()

public long getSize()

Returns the size in bytes of this Blob.

Returns
Type Description
long

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

toString()

public String toString()
Returns
Type Description
String
Overrides