public class WebApplicationInfo
extends java.lang.Object
WebServerUtilities
Constructor and Description |
---|
WebApplicationInfo(java.lang.String modelName,
java.lang.String applicationPath,
FileParameter temporaryFileLocation)
Construct a new instance of this class with the given model name, an
application path, and a temporary file location.
|
Modifier and Type | Method and Description |
---|---|
void |
addResourceInfo(java.net.URI resourcePath,
java.util.Set<org.eclipse.jetty.util.resource.Resource> resourceLocations)
Add a new resource path and location set for this web application.
|
void |
addServletInfo(java.net.URI servletPath,
javax.servlet.Servlet servlet)
Add a new servlet path to the set of paths of this web application.
|
java.net.URI |
getApplicationPath()
Get the base path of this web application.
|
java.lang.String |
getModelName()
Get the full model name of the model that is running the web application.
|
java.util.HashMap<java.net.URI,java.util.HashSet<org.eclipse.jetty.util.resource.Resource>> |
getResourceInfo()
Get the set of resource paths and their associated locations.
|
java.util.HashMap<java.net.URI,javax.servlet.Servlet> |
getServletInfo()
Get the set of servlet paths assigned to this web application and their
corresponding servlets.
|
FileParameter |
getTemporaryFileLocation()
Get the location where temporary files should be stored.
|
boolean |
hasPath(java.lang.String path)
Returns true if the web application has already mapped a handler to the
given URL; returns false otherwise.
|
boolean |
hasPath(java.net.URI path)
Returns true if the web application has already mapped a handler to the
given URL; returns false otherwise.
|
boolean |
hasResourcePath(java.lang.String path)
Returns true if the web application has already mapped a resource
handler to the given path.
|
void |
setApplicationPath(java.net.URI applicationPath)
Set the base path of this application.
|
void |
setModelName(java.lang.String modelName)
Record the full model name from the model that is running the web
application.
|
void |
setTemporaryFileLocation(FileParameter temporaryFileLocation)
Set the location where temporary files should be stored.
|
public WebApplicationInfo(java.lang.String modelName, java.lang.String applicationPath, FileParameter temporaryFileLocation) throws java.lang.Exception
modelName
- The full name of the modelapplicationPath
- The base path for the applicationtemporaryFileLocation
- The directory where temporary files are
storedjava.lang.Exception
- If the model does not yet have a name (for example,
a new unsaved model)public void addServletInfo(java.net.URI servletPath, javax.servlet.Servlet servlet) throws java.lang.Exception
servletPath
- The new servlet path to addservlet
- The servlet to associated with the servlet pathjava.lang.Exception
- If the path has already been requested by another servletpublic void addResourceInfo(java.net.URI resourcePath, java.util.Set<org.eclipse.jetty.util.resource.Resource> resourceLocations) throws java.lang.Exception
resourcePath
- The new resource path to add. May not be null.resourceLocations
- The non-empty set of resource locations to addjava.lang.Exception
- If this path is a duplicate of a path already requested by
a servlet, or if the resource does not existpublic java.net.URI getApplicationPath()
setApplicationPath(URI)
public java.util.HashMap<java.net.URI,javax.servlet.Servlet> getServletInfo()
public java.lang.String getModelName()
setModelName(String)
public java.util.HashMap<java.net.URI,java.util.HashSet<org.eclipse.jetty.util.resource.Resource>> getResourceInfo()
public FileParameter getTemporaryFileLocation()
setTemporaryFileLocation(FileParameter)
public boolean hasPath(java.lang.String path)
path
- The URL to check for existing mappingspublic boolean hasPath(java.net.URI path)
hasPath(String path)
path
- The URL to check for existing mappingspublic boolean hasResourcePath(java.lang.String path)
path
- The URL to check for existing mappings to a resource handlerpublic void setApplicationPath(java.net.URI applicationPath)
applicationPath
- The new base path to this applicationgetApplicationPath()
public void setModelName(java.lang.String modelName)
modelName
- The full model name of the model that is running the
web applicationgetModelName()
public void setTemporaryFileLocation(FileParameter temporaryFileLocation)
temporaryFileLocation
- The location where temporary files should
be stored. May be null if the web application does not use temporary
filesgetTemporaryFileLocation()