Class BlobInfoFactory (2.0.0)

public class BlobInfoFactory

BlobInfoFactory provides a trivial interface for retrieving BlobInfo metadata.

BlobInfo metadata is stored in read-only BlobInfo entities in the datastore. This class provides an easy way to access these entities. For more complex queries, you can use the datastore directly.

Inheritance

java.lang.Object > BlobInfoFactory

Static Fields

CONTENT_TYPE

public static final String CONTENT_TYPE
Field Value
Type Description
String

CREATION

public static final String CREATION
Field Value
Type Description
String

FILENAME

public static final String FILENAME
Field Value
Type Description
String

GS_OBJECT_NAME

public static final String GS_OBJECT_NAME
Field Value
Type Description
String

KIND

public static final String KIND
Field Value
Type Description
String

MD5_HASH

public static final String MD5_HASH
Field Value
Type Description
String

SIZE

public static final String SIZE
Field Value
Type Description
String

Constructors

BlobInfoFactory()

public BlobInfoFactory()

Creates a BlobInfoFactory that uses the default implementation of DatastoreService.

BlobInfoFactory(DatastoreService datastoreService)

public BlobInfoFactory(DatastoreService datastoreService)

Creates a BlobInfoFactory with the specified implementation of DatastoreService.

Parameter
Name Description
datastoreService DatastoreService

Methods

createBlobInfo(Entity entity)

public BlobInfo createBlobInfo(Entity entity)

Creates a BlobInfo by extracting content from the specified Entity.

Parameter
Name Description
entity Entity
Returns
Type Description
BlobInfo

loadBlobInfo(BlobKey blobKey)

public @Nullable BlobInfo loadBlobInfo(BlobKey blobKey)

Loads the BlobInfo metadata for blobKey. Returns null if no matching blob is found.

Parameter
Name Description
blobKey BlobKey
Returns
Type Description
@org.checkerframework.checker.nullness.qual.Nullable com.google.appengine.api.blobstore.BlobInfo

queryBlobInfos()

public Iterator<BlobInfo> queryBlobInfos()

Queries for BlobInfo instances, beginning with the BlobKey that appears first in lexicographic order.

Returns
Type Description
Iterator<BlobInfo>

queryBlobInfosAfter(@Nullable BlobKey previousBlob)

public Iterator<BlobInfo> queryBlobInfosAfter(@Nullable BlobKey previousBlob)

Queries for BlobInfo instances, beginning at the blob following previousBlob in lexicographic order. If previousBlob is null, the first blob will be returned.

This is useful for displaying discrete pages of blobs.

Parameter
Name Description
previousBlob @org.checkerframework.checker.nullness.qual.Nullable com.google.appengine.api.blobstore.BlobKey
Returns
Type Description
Iterator<BlobInfo>