Class ResolverDirectHTTP
java.lang.Object
org.apache.xml.security.utils.resolver.ResourceResolverSpi
org.apache.xml.security.utils.resolver.implementations.ResolverDirectHTTP
A simple ResourceResolver for HTTP requests. This class handles only 'pure'
HTTP URIs which means without a fragment. The Fragment handling is done by the
If the user has a corporate HTTP proxy which is to be used, the usage can be switched on by setting properties for the resolver:
ResolverFragment
class.
If the user has a corporate HTTP proxy which is to be used, the usage can be switched on by setting properties for the resolver:
resourceResolver.setProperty("http.proxy.host", "proxy.company.com"); resourceResolver.setProperty("http.proxy.port", "8080"); // if we need a password for the proxy resourceResolver.setProperty("http.proxy.username", "proxyuser3"); resourceResolver.setProperty("http.proxy.password", "secretca");
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
Field HttpProxyPassprivate static final int
Field HttpProxyUserprivate static final int
Field HttpProxyHostprivate static final int
Field HttpProxyPassprivate static final int
Field HttpProxyPortprivate static final int
Field HttpProxyUserprivate static final org.slf4j.Logger
private static final String[]
Field properties[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
We resolve http URIs without fragment...String[]
Method engineGetPropertyKeysboolean
Tells if the implementation does can be reused by several threads safely.engineResolveURI
(ResourceResolverContext context) This is the workhorse method used to resolve resources.private static URI
private URLConnection
openConnection
(URL url) Methods inherited from class org.apache.xml.security.utils.resolver.ResourceResolverSpi
engineAddProperies, engineGetProperty, engineSetProperty, fixURI, understandsProperty
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
properties
Field properties[] -
HttpProxyHost
private static final int HttpProxyHostField HttpProxyHost- See Also:
-
HttpProxyPort
private static final int HttpProxyPortField HttpProxyPort- See Also:
-
HttpProxyUser
private static final int HttpProxyUserField HttpProxyUser- See Also:
-
HttpProxyPass
private static final int HttpProxyPassField HttpProxyPass- See Also:
-
HttpBasicUser
private static final int HttpBasicUserField HttpProxyUser- See Also:
-
HttpBasicPass
private static final int HttpBasicPassField HttpProxyPass- See Also:
-
-
Constructor Details
-
ResolverDirectHTTP
public ResolverDirectHTTP()
-
-
Method Details
-
engineIsThreadSafe
public boolean engineIsThreadSafe()Description copied from class:ResourceResolverSpi
Tells if the implementation does can be reused by several threads safely. It normally means that the implementation does not have any member, or there is member change between engineCanResolve and engineResolve invocations. Or it maintains all member info in ThreadLocal methods.- Overrides:
engineIsThreadSafe
in classResourceResolverSpi
-
engineResolveURI
public XMLSignatureInput engineResolveURI(ResourceResolverContext context) throws ResourceResolverException This is the workhorse method used to resolve resources.- Specified by:
engineResolveURI
in classResourceResolverSpi
- Parameters:
context
- Context to use to resolve resources.- Returns:
- the resource wrapped around a XMLSignatureInput
- Throws:
ResourceResolverException
-
openConnection
- Throws:
IOException
-
engineCanResolveURI
We resolve http URIs without fragment...- Specified by:
engineCanResolveURI
in classResourceResolverSpi
- Parameters:
context
-- Returns:
- true if can be resolved
-
engineGetPropertyKeys
Method engineGetPropertyKeys- Overrides:
engineGetPropertyKeys
in classResourceResolverSpi
- Returns:
- the property keys
-
getNewURI
- Throws:
URISyntaxException
-