public class Application
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
cleanStagingDirectory()
deletes the staging directory, if one was created.
|
java.io.File |
createStagingDirectory(AppAdminFactory.ApplicationProcessingOptions opts,
ResourceLimits resourceLimits)
Creates a new staging directory, if needed, or returns the existing one
if already created.
|
java.lang.String |
getApiVersion()
Returns the desired API version for the current application, or
"none" if no API version was used. |
AppEngineWebXml |
getAppEngineWebXml()
Returns the AppEngineWebXml describing the application.
|
java.lang.String |
getAppId()
Returns the application identifier, from the AppEngineWebXml config
|
java.lang.String |
getAppYaml()
Returns the app.yaml string.
|
BackendsXml |
getBackendsXml() |
CronXml |
getCronXml()
Returns the CronXml describing the applications' cron jobs.
|
DosXml |
getDosXml()
Returns the DosXml describing the applications' DoS entries.
|
java.util.List<ErrorHandler> |
getErrorHandlers() |
IndexesXml |
getIndexesXml()
Returns the IndexesXml describing the applications' indexes.
|
java.lang.String |
getInstanceClass() |
java.lang.String |
getMimeTypeIfStatic(java.lang.String path) |
java.lang.String |
getPagespeedYaml()
Returns the pagespeed.yaml describing the applications' PageSpeed configuration.
|
java.lang.String |
getPath()
Returns a path to an exploded WAR directory for the application.
|
QueueXml |
getQueueXml()
Returns the QueueXml describing the applications' task queues.
|
java.lang.String |
getServer() |
java.lang.String |
getSourceLanguage() |
java.io.File |
getStagingDir()
Returns the staging directory, or
null if none has been created. |
java.lang.String |
getVersion()
Returns the application version, from the AppEngineWebXml config
|
WebXml |
getWebXml()
Returns the WebXml describing the applications' servlets and generic web
application information.
|
static java.lang.String |
guessContentTypeFromName(java.lang.String fileName) |
boolean |
isPrecompilationEnabled() |
static Application |
readApplication(java.lang.String path)
Reads the App Engine application from
path. |
static Application |
readApplication(java.lang.String path,
java.lang.String appId,
java.lang.String server,
java.lang.String appVersion)
Reads the App Engine application from
path. |
static void |
recursiveDelete(java.io.File dead)
Recursive directory deletion.
|
void |
resetProgress() |
void |
setDetailsWriter(java.io.PrintWriter detailsWriter) |
void |
setExternalResourceDir(java.lang.String path)
Sets the external resource directory.
|
void |
setListener(UpdateListener l) |
void |
statusUpdate(java.lang.String message) |
void |
statusUpdate(java.lang.String message,
int amount) |
public static Application readApplication(java.lang.String path) throws java.io.IOException
path. The path may either
be a WAR file or the root of an exploded WAR directory.path - a not null path.java.io.IOException - if an error occurs while trying to read the
Application.com.google.apphosting.utils.config.AppEngineConfigException - if the
Application's appengine-web.xml file is malformed.public void setExternalResourceDir(java.lang.String path)
#createStagingDirectory(ApplicationProcessingOptions, ResourceLimits).
The external resource directory is a directory outside of the war directory where additional files live. These files will be copied into the staging directory during an upload, after the war directory is copied there. Consequently if there are any name collisions the files in the external resource directory will win.
path - a not null path to an existing directory.java.lang.IllegalArgumentException - If path does not refer to an existing
directory.public static Application readApplication(java.lang.String path, java.lang.String appId, java.lang.String server, java.lang.String appVersion) throws java.io.IOException
path. The path may either
be a WAR file or the root of an exploded WAR directory.path - a not null path.appId - if non-null, use this as an application id override.server - if non-null, use this as an server id override.appVersion - if non-null, use this as an application version override.java.io.IOException - if an error occurs while trying to read the
Application.com.google.apphosting.utils.config.AppEngineConfigException - if the
Application's appengine-web.xml file is malformed.public java.lang.String getAppId()
public java.lang.String getVersion()
public java.lang.String getSourceLanguage()
public java.lang.String getServer()
public java.lang.String getInstanceClass()
public boolean isPrecompilationEnabled()
public java.util.List<ErrorHandler> getErrorHandlers()
public java.lang.String getMimeTypeIfStatic(java.lang.String path)
public static java.lang.String guessContentTypeFromName(java.lang.String fileName)
fileName - path of a file with extensionpublic AppEngineWebXml getAppEngineWebXml()
null deployment descriptorpublic CronXml getCronXml()
nullpublic QueueXml getQueueXml()
nullpublic DosXml getDosXml()
nullpublic java.lang.String getPagespeedYaml()
nullpublic IndexesXml getIndexesXml()
nullpublic WebXml getWebXml()
nullpublic BackendsXml getBackendsXml()
public java.lang.String getApiVersion()
"none" if no API version was used.java.lang.IllegalStateException - if createStagingDirectory has not been called.public java.lang.String getPath()
null path pointing to a directorypublic java.io.File getStagingDir()
null if none has been created.public void resetProgress()
public java.io.File createStagingDirectory(AppAdminFactory.ApplicationProcessingOptions opts, ResourceLimits resourceLimits) throws java.io.IOException
opts - User-specified options for processing the application.java.io.IOExceptionpublic void cleanStagingDirectory()
public static void recursiveDelete(java.io.File dead)
public void setListener(UpdateListener l)
public void setDetailsWriter(java.io.PrintWriter detailsWriter)
public void statusUpdate(java.lang.String message,
int amount)
public void statusUpdate(java.lang.String message)
public java.lang.String getAppYaml()
java.lang.IllegalStateException - if createStagingDirectory has not been called.