Stay organized with collections
Save and categorize content based on your preferences.
publicclassFileInfo
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eFileInfo\u003c/code\u003e class holds metadata about an uploaded file, gathered from HTTP headers during the upload process.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eFileInfo\u003c/code\u003e constructor, \u003ccode\u003eFileInfo(String contentType, Date creation, String filename, long size, String md5Hash, @Nullable String gsObjectName)\u003c/code\u003e, allows for creating a \u003ccode\u003eFileInfo\u003c/code\u003e object with specified metadata parameters such as content type, creation date, filename, size, MD5 hash, and Google Cloud Storage object name.\u003c/p\u003e\n"],["\u003cp\u003eSeveral methods, including \u003ccode\u003egetContentType()\u003c/code\u003e, \u003ccode\u003egetCreation()\u003c/code\u003e, \u003ccode\u003egetFilename()\u003c/code\u003e, \u003ccode\u003egetGsObjectName()\u003c/code\u003e, \u003ccode\u003egetMd5Hash()\u003c/code\u003e, and \u003ccode\u003egetSize()\u003c/code\u003e, provide access to different metadata properties of the uploaded file.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eFileInfo\u003c/code\u003e includes inherited methods like \u003ccode\u003eequals()\u003c/code\u003e, \u003ccode\u003ehashCode()\u003c/code\u003e, and \u003ccode\u003etoString()\u003c/code\u003e which are overridden to provide specific implementations for file information comparison, hash calculation, and string representation, respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe information within FileInfo comes from the parsing of HTTP headers as outlined in the RFC 1867 specification.\u003c/p\u003e\n"]]],[],null,["# Class FileInfo (2.0.0)\n\n public class FileInfo\n\n`FileInfo` contains metadata about an uploaded file. This metadata is\ngathered by parsing the HTTP headers included in the file upload.\nSee Also: [RFC 1867](http://tools.ietf.org/html/rfc1867) for the specification of HTTP file uploads. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e FileInfo \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nConstructors\n------------\n\n### FileInfo(String contentType, Date creation, String filename, long size, String md5Hash, @Nullable String gsObjectName)\n\n public FileInfo(String contentType, Date creation, String filename, long size, String md5Hash, @Nullable String gsObjectName)\n\nCreates a `FileInfo` by providing the associated metadata.\nThis is done by the API on the developer's behalf.\n\nMethods\n-------\n\n### equals(@Nullable Object obj)\n\n public boolean equals(@Nullable Object obj)\n\n**Overrides** \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-)\n\n### getContentType()\n\n public String getContentType()\n\nReturns the MIME Content-Type provided in the HTTP header during upload of\nthis Blob.\n\n### getCreation()\n\n public Date getCreation()\n\nReturns the time and date the blob was upload.\n\n### getFilename()\n\n public String getFilename()\n\nReturns the file included in the Content-Disposition HTTP header during\nupload of this Blob.\n\n### getGsObjectName()\n\n public @Nullable String getGsObjectName()\n\nReturns the name of the file written to Google Cloud Storage or null if the file was not\nuploaded to Google Cloud Storage. This property is only available for BlobInfos returned by\ngetUploadedBlobInfos(), as its value is not persisted in the Datastore. Any attempt to\naccess this property on other BlobInfos will return null.\n\n### getMd5Hash()\n\n public String getMd5Hash()\n\nReturns the md5Hash of this Blob.\n\n### getSize()\n\n public long getSize()\n\nReturns the size in bytes of this Blob.\n\n### hashCode()\n\n public int hashCode()\n\n**Overrides** \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--)\n\n### toString()\n\n public String toString()\n\n**Overrides** \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)"]]