com.google.appengine.api.files.dev
Class GSFile
java.lang.Object
com.google.appengine.api.files.dev.FileMetadata
com.google.appengine.api.files.dev.GSFile
public class GSFile
- extends FileMetadata
A Google Cloud Storage object represented by a local file in blobstore.
Appendable versions of GSFiles have paths of the form
/gs/writable:random?name=bucket%2fkey. Unfinalized bytes are
stored in memory. Finalizing an object copies the bytes
to a local blobstore file, which is accessible at
/gs/bucket/key.
Constructor Summary |
GSFile(java.lang.String readName,
java.lang.String appendName,
ContentType contentType,
boolean finalized,
LocalFileService localFileService)
|
Methods inherited from class com.google.appengine.api.files.dev.FileMetadata |
append, checkParameters, copy, getAppendName, getContentType, getLockState, getOpenState, isFinalized, isOpenInDifferentSession, lock, newReadableInstance, read, setFinalized, setState |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
GSFile
public GSFile(java.lang.String readName,
java.lang.String appendName,
ContentType contentType,
boolean finalized,
LocalFileService localFileService)
buildWritablePath
public static java.lang.String buildWritablePath(java.lang.String randomString,
java.lang.String fileName)
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. There are two cases:
1) A create request
2) A read request for a special read-only file.
newFinalizedInstance
protected static FileMetadata newFinalizedInstance(LocalFileService localFileService,
Clock clock,
ParsedFileName parsedName)
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