Package de.xima.fc.security.access
Class ListedResourceAccessControl
- java.lang.Object
-
- de.xima.fc.security.access.ListedResourceAccessControl
-
- All Implemented Interfaces:
IResourceAccessControl
@Immutable @ThreadSafe public final class ListedResourceAccessControl extends Object implements IResourceAccessControl
ImplementsIResourceAccessControl
with a blacklist and whitelist. When the resource matches any entry in the blacklist, access to the resource is forbidden (irrespective of the whitelist). Otherwise, when no blacklist entry matches, access to the resource is allowed when it matches at least one of the whitelist entries, and forbidden otherwise.- Since:
- 7.0.10
- Author:
- XIMA MEDIA GmbH
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ListedResourceAccessControl.ListedResourceAccessControlBuilder
Simple builder for configuring aListedResourceAccessControl
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isAccessAllowed(URI uri)
Checks whether the given URI may be accessed or whether access is forbidden.boolean
isAccessAllowed(URL url)
Checks whether the given URL may be accessed or whether access is forbidden.
-
-
-
Method Detail
-
isAccessAllowed
public boolean isAccessAllowed(URI uri) throws ResourceAccessCheckException
Description copied from interface:IResourceAccessControl
Checks whether the given URI may be accessed or whether access is forbidden.- Specified by:
isAccessAllowed
in interfaceIResourceAccessControl
- Parameters:
uri
- URI to check.- Returns:
true
when the URI may be accessed,false
otherwise.- Throws:
ResourceAccessCheckException
- When the URI could not be checked. The exact behavior when an exception is thrown depends on the logic that uses this interface.
-
isAccessAllowed
public boolean isAccessAllowed(URL url) throws ResourceAccessCheckException
Description copied from interface:IResourceAccessControl
Checks whether the given URL may be accessed or whether access is forbidden.- Specified by:
isAccessAllowed
in interfaceIResourceAccessControl
- Parameters:
url
- URL to check.- Returns:
true
when the URL may be accessed,false
otherwise.- Throws:
ResourceAccessCheckException
- When the URL could not be checked. The exact behavior when an exception is thrown depends on the logic that uses this interface.
-
-