Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.google.appengine.api.files.dev
Class BlobstoreFile

    java.lang.Object
      com.google.appengine.api.files.dev.FileMetadata
          com.google.appengine.api.files.dev.BlobstoreFile

    public class BlobstoreFile

extends FileMetadata

Represents a file in the local file service that is stored in the BlobStore. For each BlobStore file there are two instances of this class: one corresponding to the creation-handle which is write-only, and one corresponding to the blob key which is read-only. Each instance will eventually contain both the creation handle and the blob key Strings so that it is possible to find one from the other.

Nested Class Summary

Nested classes/interfaces inherited from class com.google.appengine.api.files.dev.FileMetadata
`FileMetadata.LockState, FileMetadata.OpenState`

Field Summary
`static java.lang.String` | `CREATION_HANDLE_PREFIX`
`static java.lang.String` | `FILE_SYSTEM`

Fields inherited from class com.google.appengine.api.files.dev.FileMetadata
`appendName, contentType, currentSequenceKey, finalized, readName, tempBytes, tempBytesSizeWhenFinalized`

Method Summary
`static java.lang.String` | `buildFullPath(java.lang.String namePart)`
`static FileMetadata` | `create(LocalFileService localFileService, Clock clock, java.lang.String fileName, java.lang.String randomString, ContentType contentType, java.util.Map<java.lang.String,java.lang.String> parameters)` Creates a new instance for a non-finalized file.
`com.google.appengine.api.blobstore.BlobInfo` | `getBlobInfo()`
`protected java.io.InputStream` | `getInputStream()`
`protected java.io.OutputStream` | `getOutputStream()`
`static FileMetadata` | `newFinalizedInstance(LocalFileService localFileService, Clock clock, ParsedFileName parsedName)` Given a `ParsedFileName` for a Blobstore file that is expected to have been finalized, this method will attempt to construct and return a new `FileMetadata` instance for the file.
`void` | `setFinalized()`

Methods inherited from class com.google.appengine.api.files.dev.FileMetadata
`append, checkParameters, copy, getAppendName, getContentType, getLockState, getOpenState, getTempBytesSize, isFinalized, isOpenInDifferentSession, lock, newReadableInstance, read, saveBlobInfo, setState`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### FILE_SYSTEM

    public static final java.lang.String FILE_SYSTEM

### CREATION_HANDLE_PREFIX

    public static final java.lang.String CREATION_HANDLE_PREFIX

See Also:
  Constant Field Values

Method Detail

### buildFullPath

    public static java.lang.String buildFullPath(java.lang.String namePart)

### create

    public static FileMetadata create(LocalFileService localFileService,
                                      Clock clock,
                                      java.lang.String fileName,
                                      java.lang.String randomString,
                                      ContentType contentType,
                                      java.util.Map<java.lang.String,java.lang.String> parameters)

  Creates a new instance for a non-finalized file.

### newFinalizedInstance

    public static FileMetadata newFinalizedInstance(LocalFileService localFileService,
                                                    Clock clock,
                                                    ParsedFileName parsedName)

  Given a `ParsedFileName` for a Blobstore file that is expected to have been finalized, this method will attempt to construct and return a new `FileMetadata` instance for the file. If the file name represents a blob key, then an instance will be returned wrapping the blob key. If the name represents a creation handle then this method will query the datastore in order to find a blob key corresponding to the creation handle. If one is found then an instance will be returned. Otherwise `null` will be returned.

  Returns:
    An instance of `FileMetadata` or `null` if no corresponding entity could be found in the datastore.

### getBlobInfo

    public com.google.appengine.api.blobstore.BlobInfo getBlobInfo()

  Specified by:
    `getBlobInfo` in class `FileMetadata`
  Returns:
    the `BlobInfo` of the file. File must have been finalized.

### setFinalized

    public void setFinalized()

  Overrides:
    `setFinalized` in class `FileMetadata`

### getOutputStream

    protected java.io.OutputStream getOutputStream()
                                            throws java.io.IOException

  Specified by:
    `getOutputStream` in class `FileMetadata`
  Throws:
    `java.io.IOException`

### getInputStream

    protected java.io.InputStream getInputStream()
                                          throws java.io.IOException

  Specified by:
    `getInputStream` in class `FileMetadata`
  Throws:
    `java.io.IOException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD