Class ResourceResolver
java.lang.Object
org.apache.xml.security.utils.resolver.ResourceResolver
During reference validation, we have to retrieve resources from somewhere.
This is done by retrieving a Resolver. The resolver needs two arguments: The
URI in which the link to the new resource is defined and the baseURI of the
file/entity in which the URI occurs (the baseURI is the same as the SystemId).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static boolean
private static final org.slf4j.Logger
private static final List<ResourceResolver>
these are the system-wide resolversprivate final ResourceResolverSpi
Field resolverSpi -
Constructor Summary
ConstructorsConstructorDescriptionResourceResolver
(ResourceResolverSpi resourceResolver) Constructor ResourceResolver -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProperties
(Map<String, String> properties) Method addPropertiesprivate boolean
canResolve
(ResourceResolverContext context) Method canResolvestatic final ResourceResolver
getInstance
(Attr uriAttr, String baseURI, boolean secureValidation) Method getInstancestatic ResourceResolver
getInstance
(Attr uri, String baseURI, List<ResourceResolver> individualResolvers) Method getInstancestatic ResourceResolver
getInstance
(Attr uri, String baseURI, List<ResourceResolver> individualResolvers, boolean secureValidation) Method getInstancegetProperty
(String key) Method getPropertyString[]
Method getPropertyKeysprivate static <N> ResourceResolver
static boolean
isURISafeToResolve
(Attr uriAttr, String baseUri) static void
register
(Class<? extends ResourceResolverSpi> className, boolean start) Registers a ResourceResolverSpi class.static void
Registers a ResourceResolverSpi class.static void
register
(ResourceResolverSpi resourceResolverSpi, boolean start) Registers a ResourceResolverSpi instance.static void
registerAtStart
(String className) Registers a ResourceResolverSpi class at the beginning of the provider list.static void
This method registers the default resolvers.Method resolvevoid
setProperty
(String key, String value) Method setPropertyboolean
understandsProperty
(String propertyToTest) Method understandsProperty
-
Field Details
-
allowUnsafeResourceResolving
private static boolean allowUnsafeResourceResolving -
LOG
private static final org.slf4j.Logger LOG -
resolverList
these are the system-wide resolvers -
resolverSpi
Field resolverSpi
-
-
Constructor Details
-
ResourceResolver
Constructor ResourceResolver- Parameters:
resourceResolver
-
-
-
Method Details
-
getInstance
public static final ResourceResolver getInstance(Attr uriAttr, String baseURI, boolean secureValidation) throws ResourceResolverException Method getInstance- Parameters:
uriAttr
-baseURI
-secureValidation
-- Returns:
- the instance
- Throws:
ResourceResolverException
-
internalGetInstance
private static <N> ResourceResolver internalGetInstance(ResourceResolverContext context) throws ResourceResolverException - Throws:
ResourceResolverException
-
getInstance
public static ResourceResolver getInstance(Attr uri, String baseURI, List<ResourceResolver> individualResolvers) throws ResourceResolverException Method getInstance- Parameters:
uri
-baseURI
-individualResolvers
-- Returns:
- the instance
- Throws:
ResourceResolverException
-
getInstance
public static ResourceResolver getInstance(Attr uri, String baseURI, List<ResourceResolver> individualResolvers, boolean secureValidation) throws ResourceResolverException Method getInstance- Parameters:
uri
-baseURI
-individualResolvers
-secureValidation
-- Returns:
- the instance
- Throws:
ResourceResolverException
-
register
Registers a ResourceResolverSpi class. This method LOGs a warning if the class cannot be registered.- Parameters:
className
- the name of the ResourceResolverSpi class to be registered- Throws:
SecurityException
- if a security manager is installed and the caller does not have permission to register a resource resolver
-
registerAtStart
Registers a ResourceResolverSpi class at the beginning of the provider list. This method LOGs a warning if the class cannot be registered.- Parameters:
className
- the name of the ResourceResolverSpi class to be registered- Throws:
SecurityException
- if a security manager is installed and the caller does not have permission to register a resource resolver
-
register
Registers a ResourceResolverSpi class. This method LOGs a warning if the class cannot be registered.- Parameters:
className
-start
-- Throws:
SecurityException
- if a security manager is installed and the caller does not have permission to register a resource resolver
-
register
Registers a ResourceResolverSpi instance. This method LOGs a warning if the class cannot be registered.- Parameters:
resourceResolverSpi
-start
-- Throws:
SecurityException
- if a security manager is installed and the caller does not have permission to register a resource resolver
-
registerDefaultResolvers
public static void registerDefaultResolvers()This method registers the default resolvers. -
resolve
public XMLSignatureInput resolve(Attr uri, String baseURI, boolean secureValidation) throws ResourceResolverException Method resolve- Parameters:
uri
-baseURI
-- Returns:
- the resource
- Throws:
ResourceResolverException
-
setProperty
Method setProperty- Parameters:
key
-value
-
-
getProperty
Method getProperty- Parameters:
key
-- Returns:
- the value of the property
-
addProperties
Method addProperties- Parameters:
properties
-
-
getPropertyKeys
Method getPropertyKeys- Returns:
- all property keys.
-
understandsProperty
Method understandsProperty- Parameters:
propertyToTest
-- Returns:
- true if the resolver understands the property
-
isURISafeToResolve
-
canResolve
Method canResolve- Parameters:
context
-- Returns:
- true if it can resolve the uri
-