|
||||||||||
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 org.apache.wicket.markup.html.SecurePackageResourceGuard
public class SecurePackageResourceGuard
This is a resource guard which by default denies access to all resources and thus is more secure.
All pattern are executed in the order they were provided. All pattern are executed to determine if access can be granted or not. Note that access to the config data such as get/setPattern() and acceptXXX() is not synchronized. It is assumed that configuration has finished before the first request gets executed. The rules are fairly simple. Each pattern must start with either "+" (include) or "-" (exclude). "*" is a placeholder for zero, one or more characters within a file or directory name. "**" is a placeholder for zero, one or more sub-directories. Examples:+*.gif | All gif files in all directories |
+test*.* | All files in all directories starting with "test" |
+mydir/*/*.gif | All gif files two levels below the mydir directory. E.g. mydir/dir2/test.gif |
+mydir/**/*.gif | All gif files in all directories below mydir. E.g. mydir/test.gif or mydir/dir2/dir3/test.gif |
IPackageResourceGuard
,
IResourceSettings.getPackageResourceGuard()
,
PackageResourceGuard
Nested Class Summary | |
---|---|
static class |
SecurePackageResourceGuard.SearchPattern
|
static class |
SecurePackageResourceGuard.SimpleCache
A very simple cache |
Constructor Summary | |
---|---|
SecurePackageResourceGuard()
Constructor. |
|
SecurePackageResourceGuard(ConcurrentMap<String,Boolean> cache)
Constructor. |
Method Summary | |
---|---|
protected boolean |
acceptAbsolutePath(String path)
Whether the provided absolute path is accepted. |
void |
addPattern(String pattern)
|
void |
clearCache()
|
List<SecurePackageResourceGuard.SearchPattern> |
getPattern()
Gets the current list of pattern. |
ConcurrentHashMap<String,Boolean> |
newCache()
Deprecated. Pass the cache as a parameter to the constructor |
void |
setPattern(List<SecurePackageResourceGuard.SearchPattern> pattern)
Sets pattern. |
Methods inherited from class org.apache.wicket.markup.html.PackageResourceGuard |
---|
accept, acceptExtension, acceptFile, getBlockedExtensions, getBlockedFiles, isAllowAccessToRootResources, setAllowAccessToRootResources, setBlockedExtensions, setBlockedFiles |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SecurePackageResourceGuard()
public SecurePackageResourceGuard(ConcurrentMap<String,Boolean> cache)
cache
- the internal cache that will hold the results for all already checked resources.
Use null
to disable caching.Method Detail |
---|
@Deprecated public ConcurrentHashMap<String,Boolean> newCache()
public void clearCache()
protected boolean acceptAbsolutePath(String path)
acceptAbsolutePath
in class PackageResourceGuard
path
- The absolute path, starting from the class root (packages are separated with
forward slashes instead of dots).
public List<SecurePackageResourceGuard.SearchPattern> getPattern()
public void setPattern(List<SecurePackageResourceGuard.SearchPattern> pattern)
pattern
- patternpublic void addPattern(String pattern)
pattern
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |