Top Fields Constructors Methods
org.apache.catalina.webresources

public abstract Class AbstractFileResourceSet

extends AbstractResourceSet
Class Inheritance
Known Direct Subclasses
org.apache.catalina.webresources.DirResourceSet, org.apache.catalina.webresources.FileResourceSet
Imports
java.io.File, .IOException, java.net.MalformedURLException, .URL, org.apache.catalina.LifecycleException, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.compat.JrePlatform, org.apache.tomcat.util.http.RequestUtil

Field Summary

Modifier and TypeField and Description
private String
private String
protected static final String[]
private File
private static final Log
private boolean
Inherited from org.apache.catalina.webresources.AbstractResourceSet:
sm

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected abstract void
protected final File
file(String name, boolean mustExist)

public void
gc()

Implements org.apache.catalina.WebResourceSet.gc.

Implementations may cache some information to improve performance.

public URL
getBaseUrl()

Implements org.apache.catalina.WebResourceSet.getBaseUrl.

Obtain the base URL for this set of resources.

protected final File
protected void
initInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.initInternal.

Sub-classes implement this method to perform any instance initialisation required.

private boolean
public boolean
isReadOnly()

Implements org.apache.catalina.WebResourceSet.isReadOnly.

Obtains the current value of the read-only setting for this set of resources.

private String
normalize(String
Path to be normalized
path
)

Return a context-relative path, beginning with a "/", that represents the canonical version of the specified path after ".." and "." elements are resolved out.

public void
setReadOnly(boolean
true if this set of resources should be configured to be read-only
readOnly
)

Implements org.apache.catalina.WebResourceSet.setReadOnly.

Configures whether or not this set of resources is read-only.

Inherited from org.apache.catalina.webresources.AbstractResourceSet:
checkPathdestroyInternalgetBasegetClassLoaderOnlygetInternalPathgetManifestgetRootgetStaticOnlygetWebAppMountsetBasesetClassLoaderOnlysetInternalPathsetManifestsetRootsetStaticOnlysetWebAppMountstartInternalstopInternal

Field Detail

absoluteBaseback to summary
private String absoluteBase
canonicalBaseback to summary
private String canonicalBase
EMPTY_STRING_ARRAYback to summary
protected static final String[] EMPTY_STRING_ARRAY
fileBaseback to summary
private File fileBase
logback to summary
private static final Log log

Hides org.apache.catalina.util.LifecycleBase.log.

readOnlyback to summary
private boolean readOnly

Constructor Detail

AbstractFileResourceSetback to summary
protected AbstractFileResourceSet(String internalPath)

Method Detail

checkTypeback to summary
protected abstract void checkType(File file)
fileback to summary
protected final File file(String name, boolean mustExist)
gcback to summary
public void gc()

Implements org.apache.catalina.WebResourceSet.gc.

Doc from org.apache.catalina.WebResourceSet.gc.

Implementations may cache some information to improve performance. This method triggers the clean-up of those resources.

This is a NO-OP by default for File based resource sets.

Annotations
@Override
getBaseUrlback to summary
public URL getBaseUrl()

Implements org.apache.catalina.WebResourceSet.getBaseUrl.

Doc from org.apache.catalina.WebResourceSet.getBaseUrl.

Obtain the base URL for this set of resources. One of the uses of this is to grant read permissions to the resources when running under a security manager.

Returns:URL

The base URL for this set of resources

Annotations
@Override
getFileBaseback to summary
protected final File getFileBase()
initInternalback to summary
protected void initInternal() throws LifecycleException

Implements abstract org.apache.catalina.util.LifecycleBase.initInternal.

Doc from org.apache.catalina.util.LifecycleBase.initInternal.

Sub-classes implement this method to perform any instance initialisation required.

Annotations
@Override
Exceptions
LifecycleException:
If the initialisation fails
isInvalidWindowsFilenameback to summary
private boolean isInvalidWindowsFilename(String name)
isReadOnlyback to summary
public boolean isReadOnly()

Implements org.apache.catalina.WebResourceSet.isReadOnly.

Doc from org.apache.catalina.WebResourceSet.isReadOnly.

Obtains the current value of the read-only setting for this set of resources.

Returns:boolean

true if this set of resources is configured to be read-only, otherwise false

Annotations
@Override
normalizeback to summary
private String normalize(String path)

Return a context-relative path, beginning with a "/", that represents the canonical version of the specified path after ".." and "." elements are resolved out. If the specified path attempts to go outside the boundaries of the current context (i.e. too many ".." path elements are present), return null instead.

Parameters
path:String

Path to be normalized

setReadOnlyback to summary
public void setReadOnly(boolean readOnly)

Implements org.apache.catalina.WebResourceSet.setReadOnly.

Doc from org.apache.catalina.WebResourceSet.setReadOnly.

Configures whether or not this set of resources is read-only.

Parameters
readOnly:boolean

true if this set of resources should be configured to be read-only

Annotations
@Override