@Deprecated
public class AppEngineFile
extends java.lang.Object
implements java.io.Serializable
AppEngineFile
represents a file in one of the Google App Engine
file systems.
A file has a path of the form /<fileSystem>/<namePart>
. The
path consists of a file system which is one of several identifiers for
a Google App Engine file system, and a name part wich is an arbitrary
String. For example "/blobstore/Aie7uHVwtvM" is a path in which "blobstore"
is the file system and "Aie7uHVwtvM" is the name part.
The enum AppEngineFile.FileSystem
represents the available file systems. Each file
system has particular attributes regarding permanence, reliability
availability, and cost.
In the current release of Google App Engine, BLOBSTORE
and GS
are the only available file systems.
These file systems store files as blobs in the BlobStore and in Google Storage
respectively.
App Engine files may only be accessed using a particular access pattern: Newly created files may be appended to until they are finalized. After a file is finalized it may be read, but it may no longer be written.
To create a new BLOBSTORE
file use
FileService.createNewBlobFile(String)
. This returns an instance of
AppEngineFile
with a FileSystem
of BLOBSTORE
.
To create a new GS
file use
FileService.createNewGSFile(GSFileOptions)
. This returns an
instance of AppEngineFile
with a FileSystem
of GS
.
This instance cannot be used for reading. For a full file lifecycle
example, see FileService
.
Modifier and Type | Class and Description |
---|---|
static class |
AppEngineFile.FileSystem
Deprecated.
Represents the back-end storage location of a file.
|
Constructor and Description |
---|
AppEngineFile(AppEngineFile.FileSystem fileSystem,
java.lang.String namePart)
Deprecated.
Constructs an
AppEngineFile from the given data |
AppEngineFile(java.lang.String fullPath)
Deprecated.
Constructs an
AppEngineFile from the given data |
Modifier and Type | Method and Description |
---|---|
AppEngineFile.FileSystem |
getFileSystem()
Deprecated.
Returns the file system of the file.
|
java.lang.String |
getFullPath()
Deprecated.
Returns the full path of the file.
|
java.lang.String |
getNamePart()
Deprecated.
Returns the name part of the file.
|
boolean |
hasFinalizedName()
Deprecated.
|
boolean |
isReadable()
Deprecated.
Returns a boolean indicating whether or not this instance can be used for
reading.
|
boolean |
isWritable()
Deprecated.
Returns a boolean indicating whether or not this instance can be used for
writing.
|
java.lang.String |
toString()
Deprecated.
|
public AppEngineFile(AppEngineFile.FileSystem fileSystem, java.lang.String namePart)
AppEngineFile
from the given datafileSystem
- a non-null FileSystem
.namePart
- a non-null
name part. Warning: Do not use the full
path here.public AppEngineFile(java.lang.String fullPath)
AppEngineFile
from the given datafullPath
- a non-null
full path. Warning: Do not use a name
part here.public java.lang.String getNamePart()
public java.lang.String getFullPath()
public AppEngineFile.FileSystem getFileSystem()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isWritable()
public boolean isReadable()
public boolean hasFinalizedName()