public class SecurePackageResourceGuard extends PackageResourceGuard
| +*.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,
ResourceSettings.getPackageResourceGuard(),
PackageResourceGuard| Modifier and Type | Class and Description |
|---|---|
static class |
SecurePackageResourceGuard.SearchPattern |
static class |
SecurePackageResourceGuard.SimpleCache
A very simple cache
|
| Constructor and Description |
|---|
SecurePackageResourceGuard()
Constructor.
|
SecurePackageResourceGuard(ConcurrentMap<String,Boolean> cache)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(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.
|
void |
setPattern(List<SecurePackageResourceGuard.SearchPattern> pattern)
Sets pattern.
|
acceptExtension, acceptFile, getBlockedExtensions, getBlockedFiles, isAllowAccessToRootResources, setAllowAccessToRootResources, setBlockedExtensions, setBlockedFilespublic 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.public void clearCache()
public boolean accept(String path)
accept in interface IPackageResourceGuardaccept in class PackageResourceGuardpath - The absolute path, starting from the class root (packages are separated with
forward slashes instead of dots).IPackageResourceGuard.accept(java.lang.String)public List<SecurePackageResourceGuard.SearchPattern> getPattern()
public void setPattern(List<SecurePackageResourceGuard.SearchPattern> pattern)
pattern - patternpublic void addPattern(String pattern)
pattern - Copyright © 2006–2021 Apache Software Foundation. All rights reserved.