Top Fields Constructors Methods
org.eclipse.jetty.ee10.webapp

public Class WebInfConfiguration

extends AbstractConfiguration
Class Inheritance
Imports
java.io.File, .IOException, java.net.URI, java.nio.file.Files, .Path, java.util.List, jakarta.servlet.ServletContext, org.eclipse.jetty.server.Connector, .NetworkConnector, .Server, org.eclipse.jetty.util.FileID, .IO, .StringUtil, .URIUtil, org.eclipse.jetty.util.resource.MountedPathResource, .Resource, .ResourceFactory, .Resources, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private static final Logger
public static final String
public static final String
public static final String

Constructor Summary

AccessConstructor and Description
public
protected

Method Summary

Modifier and TypeMethod and Description
public void
public void
public static String

Returns:

the canonical name for the webapp temp directory
getCanonicalNameForWebAppTmpDir
(WebAppContext
the context to get the canonical name from
context
)

Create a canonical name for a webapp temp directory.

protected static String
public void
public void
public void
resolveTempDirectory(WebAppContext
the context to resolve the temp directory from
context
)

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.

public void
Inherited from org.eclipse.jetty.ee10.webapp.AbstractConfiguration:
abortdestroygetDependenciesgetDependentsgetServerClassesgetSystemClassesisEnabledByDefaultpostConfigure

Field Detail

LOGback to summary
private static final Logger LOG
ORIGINAL_RESOURCE_BASEback to summary
public static final String ORIGINAL_RESOURCE_BASE
TEMPDIR_CONFIGUREDback to summary
public static final String TEMPDIR_CONFIGURED
TEMPORARY_RESOURCE_BASEback to summary
public static final String TEMPORARY_RESOURCE_BASE

Constructor Detail

WebInfConfigurationback to summary
public WebInfConfiguration()
WebInfConfigurationback to summary
protected WebInfConfiguration(AbstractConfiguration.Builder builder)

Method Detail

configureback to summary
public void configure(WebAppContext context) throws Exception

Overrides org.eclipse.jetty.ee10.webapp.AbstractConfiguration.configure.

Implements org.eclipse.jetty.ee10.webapp.Configuration.configure.

Doc from org.eclipse.jetty.ee10.webapp.Configuration.configure.

Configure WebApp.

Typically this step applies the discovered configuration resources to either the WebAppContext or the associated MetaData.

Parameters
context:WebAppContext

The context to configure

Annotations
@Override
Exceptions
Exception:
if unable to configure
deconfigureback to summary
public void deconfigure(WebAppContext context) throws Exception

Overrides org.eclipse.jetty.ee10.webapp.AbstractConfiguration.deconfigure.

Implements org.eclipse.jetty.ee10.webapp.Configuration.deconfigure.

Doc from org.eclipse.jetty.ee10.webapp.Configuration.deconfigure.

DeConfigure 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

Parameters
context:WebAppContext

The context to configure

Annotations
@Override
Exceptions
Exception:
if unable to deconfigure
getCanonicalNameForWebAppTmpDirback to summary
public static 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:WebAppContext

the context to get the canonical name from

Returns:String

the canonical name for the webapp temp directory

getResourceBaseNameback to summary
protected static String getResourceBaseName(Resource resource)
makeTempDirectoryback to summary
public void makeTempDirectory(File parent, WebAppContext context) throws Exception
preConfigureback to summary
public void preConfigure(final WebAppContext context) throws Exception

Overrides org.eclipse.jetty.ee10.webapp.AbstractConfiguration.preConfigure.

Implements org.eclipse.jetty.ee10.webapp.Configuration.preConfigure.

Doc from org.eclipse.jetty.ee10.webapp.Configuration.preConfigure.

Set 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.

Parameters
context:WebAppContext

The context to configure

Annotations
@Override
Exceptions
Exception:
if unable to pre configure
resolveTempDirectoryback to summary
public void resolveTempDirectory(WebAppContext context) throws 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:

  1. Iff an explicit directory is set for this webapp, use it. Set delete on exit depends on value of persistTempDirectory.
  2. If 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 temporary directory is persistent, then the random digits are not added to the name. The Server#getTempDirectory() is used for the parent of a created temporary directory.

Parameters
context:WebAppContext

the context to resolve the temp directory from

Exceptions
Exception:
if unable to resolve the temp directory
unpackback to summary
public void unpack(WebAppContext context) throws IOException