# BlobstoreFile
Date: 2011-08-17

## 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
`contentType, finalized`

Method Summary
`void` `append(AppendRequest request)` Handle an append request
`static java.lang.String` `buildFullPath(java.lang.String namePart)`
`static boolean` `isSpecialReadOnlyName(ParsedFileName parsedName)`
`static FileMetadata` `newInstance(LocalFileService localFileService, ParsedFileName parsedName, OpenMode openMode, ContentType contentType, java.util.Map<java.lang.String,java.lang.String> parameters)` Creates a new instance.
`ByteString` `read(ReadRequest request)` Handle a Read request
`void` `setFinalized()`

Methods inherited from class com.google.appengine.api.files.dev.FileMetadata
`getContentType, getLockState, getOpenState, isFinalized, isOpenInDifferentSession, lock, 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)

### isSpecialReadOnlyName

    public static boolean isSpecialReadOnlyName(ParsedFileName parsedName)

### newInstance

    public static FileMetadata newInstance(LocalFileService localFileService,
                                           ParsedFileName parsedName,
                                           OpenMode openMode,
                                           ContentType contentType,
                                           java.util.Map<java.lang.String,java.lang.String> parameters)

  Creates a new instance. There are two cases: 1) A create request 2) A read request for a special read-only file.

### append

    public void append(AppendRequest request)

  Description copied from class: `FileMetadata`
  Handle an append request

  Specified by:
    `append` in class `FileMetadata`
  Parameters:
    `request` - the request

### setFinalized

    public void setFinalized()

  Overrides:
    `setFinalized` in class `FileMetadata`

### read

    public ByteString read(ReadRequest request)

  Description copied from class: `FileMetadata`
  Handle a Read request

  Specified by:
    `read` in class `FileMetadata`
  Parameters:
    `request` - the request
  Returns:
    A `ByteString` containing the read bytes