|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.markup.html.PackageResourceGuard
public class PackageResourceGuard
Default implementation of IPackageResourceGuard
. By default, the extensions 'properties',
'class' and 'java' are blocked and files like 'log4j.xml' and 'applicationContext.xml'
A more secure implementation which by default denies access to any resource is
SecurePackageResourceGuard
Constructor Summary | |
---|---|
PackageResourceGuard()
Construct. |
Method Summary | |
---|---|
boolean |
accept(Class<?> scope,
String absolutePath)
Whether the package resource that can be reached using the provided parameters may be accessed. |
protected boolean |
acceptAbsolutePath(String path)
Whether the provided absolute path is accepted. |
protected boolean |
acceptExtension(String extension)
Whether the provided extension is accepted. |
protected boolean |
acceptFile(String file)
Whether the provided filename is accepted. |
protected Set<String> |
getBlockedExtensions()
Gets the set of extensions that are denied access. |
protected Set<String> |
getBlockedFiles()
Gets the set of extensions that are denied access. |
boolean |
isAllowAccessToWebInfResources()
Checks whether or not resources in the WEB-INF folder can be access. |
void |
setAllowAccessToWebInfResources(boolean allowAccessToRootResources)
Sets whether or not resources in the root (WEB-INF) folder can be accessed. |
protected void |
setBlockedExtensions(Set<String> blockedExtensions)
Sets the set of extensions that are denied access. |
protected void |
setBlockedFiles(Set<String> blockedFiles)
Sets the set of filenames that are denied access. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PackageResourceGuard()
Method Detail |
---|
public boolean accept(Class<?> scope, String absolutePath)
IPackageResourceGuard
accept
in interface IPackageResourceGuard
scope
- This argument will be used to get the class loader for loading the package
resourceabsolutePath
- The absolute path to the resource
IPackageResourceGuard.accept(java.lang.Class,
java.lang.String)
protected boolean acceptAbsolutePath(String path)
path
- The absolute path, starting from the class root (packages are separated with
forward slashes instead of dots).
protected boolean acceptExtension(String extension)
extension
- The extension, starting from the class root (packages are separated with forward
slashes instead of dots).
protected boolean acceptFile(String file)
file
- filename
protected final Set<String> getBlockedExtensions()
protected final Set<String> getBlockedFiles()
protected final void setBlockedExtensions(Set<String> blockedExtensions)
blockedExtensions
- Set of extensions that are denied accessprotected final void setBlockedFiles(Set<String> blockedFiles)
blockedFiles
- Set of extensions that are denied accesspublic final boolean isAllowAccessToWebInfResources()
true
iff root resources can be accessedpublic final void setAllowAccessToWebInfResources(boolean allowAccessToRootResources)
allowAccessToRootResources
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |