Stay organized with collections
Save and categorize content based on your preferences.
publicclassBlobInfoimplementsSerializable
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.
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.
[[["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-08-07 UTC."],[[["\u003cp\u003e\u003ccode\u003eBlobInfo\u003c/code\u003e is a class that stores metadata about a blob, gathered from the HTTP headers during blob uploads.\u003c/p\u003e\n"],["\u003cp\u003eThe class implements the \u003ccode\u003eSerializable\u003c/code\u003e interface and inherits from \u003ccode\u003ejava.lang.Object\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBlobInfo\u003c/code\u003e objects can be constructed with parameters like \u003ccode\u003eblobKey\u003c/code\u003e, \u003ccode\u003econtentType\u003c/code\u003e, \u003ccode\u003ecreation\u003c/code\u003e date, \u003ccode\u003efilename\u003c/code\u003e, \u003ccode\u003esize\u003c/code\u003e, and optionally, \u003ccode\u003emd5Hash\u003c/code\u003e and \u003ccode\u003egsObjectName\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBlobInfo\u003c/code\u003e contains fields such as \u003ccode\u003eblobKey\u003c/code\u003e, \u003ccode\u003econtentType\u003c/code\u003e, \u003ccode\u003ecreation\u003c/code\u003e, \u003ccode\u003efilename\u003c/code\u003e, \u003ccode\u003egsObjectName\u003c/code\u003e, \u003ccode\u003emd5Hash\u003c/code\u003e, and \u003ccode\u003esize\u003c/code\u003e, which can also be retrieved using getter methods.\u003c/p\u003e\n"],["\u003cp\u003eThe class has methods to retrieve the \u003ccode\u003eBlobKey\u003c/code\u003e of the Blob, the MIME Content-Type, the creation date, the file name, Google Cloud Storage object name, the md5Hash and the size in bytes of the Blob.\u003c/p\u003e\n"]]],[],null,["# Class BlobInfo (2.0.0)\n\n public class BlobInfo implements Serializable\n\n`BlobInfo` contains metadata about a blob. This metadata is gathered by\nparsing the HTTP headers included in the blob 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 BlobInfo \n\nImplements\n----------\n\n[Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html) \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### BlobInfo(BlobKey blobKey, String contentType, Date creation, String filename, long size)\n\n public BlobInfo(BlobKey blobKey, String contentType, Date creation, String filename, long size)\n\n### BlobInfo(BlobKey blobKey, String contentType, Date creation, String filename, long size, String md5Hash)\n\n public BlobInfo(BlobKey blobKey, String contentType, Date creation, String filename, long size, String md5Hash)\n\n### BlobInfo(BlobKey blobKey, String contentType, Date creation, String filename, long size, String md5Hash, @Nullable String gsObjectName)\n\n public BlobInfo(BlobKey blobKey, String contentType, Date creation, String filename, long size, String md5Hash, @Nullable String gsObjectName)\n\nCreates a `BlobInfo` by providing the [BlobKey](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.BlobKey) and all\nassociated metadata. This is typically done by the API on the developer's\nbehalf.\n\nFields\n------\n\n### blobKey\n\n protected final BlobKey blobKey\n\n### contentType\n\n protected final String contentType\n\n### creation\n\n protected final Date creation\n\n### filename\n\n protected final String filename\n\n### gsObjectName\n\n protected final @Nullable String gsObjectName\n\n### md5Hash\n\n protected String md5Hash\n\n### size\n\n protected final long size\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### getBlobKey()\n\n public BlobKey getBlobKey()\n\nReturns the [BlobKey](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.blobstore.BlobKey) of the Blob this `BlobInfo` describes.\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 object name of this Blob, if it is stored in Google Cloud Storage,\nin the form `/[bucket-name]/[object-name]`. Returns `null` if the Blob is stored\nin Blobstorage.\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--)"]]