- java.lang.Object
-
- org.eclipse.jetty.webapp.AbstractConfiguration
-
- org.eclipse.jetty.webapp.WebInfConfiguration
-
- All Implemented Interfaces:
Configuration
public class WebInfConfiguration extends AbstractConfiguration
-
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.jetty.util.resource.Resource_preUnpackBaseResourcestatic java.lang.StringTEMPDIR_CONFIGUREDstatic java.lang.StringTEMPORARY_RESOURCE_BASE-
Fields inherited from interface org.eclipse.jetty.webapp.Configuration
ATTR
-
-
Constructor Summary
Constructors Constructor Description WebInfConfiguration()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloneConfigure(WebAppContext template, WebAppContext context)voidconfigure(WebAppContext context)Configure WebApp.voidconfigureTempDirectory(java.io.File dir, WebAppContext context)voiddeconfigure(WebAppContext context)DeConfigure WebApp.static java.lang.StringgetCanonicalNameForWebAppTmpDir(WebAppContext context)Create a canonical name for a webapp temp directory.protected static java.lang.StringgetResourceBaseName(org.eclipse.jetty.util.resource.Resource resource)voidmakeTempDirectory(java.io.File parent, WebAppContext context)voidpreConfigure(WebAppContext context)Set up for configuration.voidresolveTempDirectory(WebAppContext context)Get a temporary directory in which to unpack the war etc etc.voidunpack(WebAppContext context)-
Methods inherited from class org.eclipse.jetty.webapp.AbstractConfiguration
abort, addDependencies, addDependencies, addDependents, addDependents, destroy, expose, getDependencies, getDependents, getServerClasses, getSystemClasses, hide, isEnabledByDefault, postConfigure, protect, protectAndExpose
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.webapp.Configuration
isAvailable, replaces
-
-
-
-
Field Detail
-
TEMPDIR_CONFIGURED
public static final java.lang.String TEMPDIR_CONFIGURED
- See Also:
- Constant Field Values
-
TEMPORARY_RESOURCE_BASE
public static final java.lang.String TEMPORARY_RESOURCE_BASE
- See Also:
- Constant Field Values
-
_preUnpackBaseResource
protected org.eclipse.jetty.util.resource.Resource _preUnpackBaseResource
-
-
Method Detail
-
preConfigure
public void preConfigure(WebAppContext context) throws java.lang.Exception
Description copied from interface:ConfigurationSet up for configuration.Typically this step discovers configuration resources. Calls to preConfigure may alter the Configurations configured on the WebAppContext, so long as configurations prior to this configuration are not altered.
- Specified by:
preConfigurein interfaceConfiguration- Overrides:
preConfigurein classAbstractConfiguration- Parameters:
context- The context to configure- Throws:
java.lang.Exception- if unable to pre configure
-
configure
public void configure(WebAppContext context) throws java.lang.Exception
Description copied from interface:ConfigurationConfigure WebApp.Typically this step applies the discovered configuration resources to either the
WebAppContextor the associatedMetaData.- Specified by:
configurein interfaceConfiguration- Overrides:
configurein classAbstractConfiguration- Parameters:
context- The context to configure- Throws:
java.lang.Exception- if unable to configure
-
deconfigure
public void deconfigure(WebAppContext context) throws java.lang.Exception
Description copied from interface:ConfigurationDeConfigure WebApp. This method is called to undo all configuration done. This is called to allow the context to work correctly over a stop/start cycle- Specified by:
deconfigurein interfaceConfiguration- Overrides:
deconfigurein classAbstractConfiguration- Parameters:
context- The context to configure- Throws:
java.lang.Exception- if unable to deconfigure
-
cloneConfigure
public void cloneConfigure(WebAppContext template, WebAppContext context) throws java.lang.Exception
- Overrides:
cloneConfigurein classAbstractConfiguration- Throws:
java.lang.Exception
-
resolveTempDirectory
public void resolveTempDirectory(WebAppContext context) throws java.lang.Exception
Get a temporary directory in which to unpack the war etc etc. The algorithm for determining this is to check these alternatives in the order shown:A. Try to use an explicit directory specifically for this webapp:
- Iff an explicit directory is set for this webapp, use it. Set delete on exit depends on value of persistTempDirectory.
- Iff jakarta.servlet.context.tempdir context attribute is set for this webapp && exists && writeable, then use it. Set delete on exit depends on value of persistTempDirectory.
B. Create a directory based on global settings. The new directory will be called
"Jetty-"+host+"-"+port+"__"+context+"-"+virtualhost+"-"+randomdigits+".dir"If the user has specified the context attribute org.eclipse.jetty.webapp.basetempdir, the directory specified by this attribute will be the parent of the temp dir created. Otherwise, the parent dir is
${java.io.tmpdir}. Set delete on exit depends on value of persistTempDirectory.- Parameters:
context- the context to resolve the temp directory from- Throws:
java.lang.Exception- if unable to resolve the temp directory
-
makeTempDirectory
public void makeTempDirectory(java.io.File parent, WebAppContext context) throws java.lang.Exception- Throws:
java.lang.Exception
-
configureTempDirectory
public void configureTempDirectory(java.io.File dir, WebAppContext context)
-
unpack
public void unpack(WebAppContext context) throws java.io.IOException
- Throws:
java.io.IOException
-
getCanonicalNameForWebAppTmpDir
public static java.lang.String getCanonicalNameForWebAppTmpDir(WebAppContext context)
Create a canonical name for a webapp temp directory.The form of the name is:
"jetty-"+host+"-"+port+"-"+resourceBase+"-_"+context+"-"+virtualhost+"-"+randomdigits+".dir"
host and port uniquely identify the server context and virtual host uniquely identify the webapp randomdigits ensure every tmp directory is unique- Parameters:
context- the context to get the canonical name from- Returns:
- the canonical name for the webapp temp directory
-
getResourceBaseName
protected static java.lang.String getResourceBaseName(org.eclipse.jetty.util.resource.Resource resource)
-
-