Class ResolverDirectHTTP
- java.lang.Object
-
- org.apache.xml.security.utils.resolver.ResourceResolverSpi
-
- org.apache.xml.security.utils.resolver.implementations.ResolverDirectHTTP
-
public class ResolverDirectHTTP extends ResourceResolverSpi
A simple ResourceResolver for HTTP requests. This class handles only 'pure' HTTP URIs which means without a fragment. The Fragment handling is done by theResolverFragment
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");
-
-
Field Summary
Fields Modifier and Type Field Description private static int
HttpBasicPass
Field HttpProxyPassprivate static int
HttpBasicUser
Field HttpProxyUserprivate static int
HttpProxyHost
Field HttpProxyHostprivate static int
HttpProxyPass
Field HttpProxyPassprivate static int
HttpProxyPort
Field HttpProxyPortprivate static int
HttpProxyUser
Field HttpProxyUserprivate static org.slf4j.Logger
LOG
private static java.lang.String[]
properties
Field properties[]
-
Constructor Summary
Constructors Constructor Description ResolverDirectHTTP()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
engineCanResolveURI(ResourceResolverContext context)
We resolve http URIs without fragment...java.lang.String[]
engineGetPropertyKeys()
Method engineGetPropertyKeysboolean
engineIsThreadSafe()
Tells if the implementation does can be reused by several threads safely.XMLSignatureInput
engineResolveURI(ResourceResolverContext context)
This is the workhorse method used to resolve resources.private static java.net.URI
getNewURI(java.lang.String uri, java.lang.String baseURI)
private java.net.URLConnection
openConnection(java.net.URL url)
-
Methods inherited from class org.apache.xml.security.utils.resolver.ResourceResolverSpi
engineAddProperies, engineGetProperty, engineSetProperty, fixURI, understandsProperty
-
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
properties
private static final java.lang.String[] properties
Field properties[]
-
HttpProxyHost
private static final int HttpProxyHost
Field HttpProxyHost- See Also:
- Constant Field Values
-
HttpProxyPort
private static final int HttpProxyPort
Field HttpProxyPort- See Also:
- Constant Field Values
-
HttpProxyUser
private static final int HttpProxyUser
Field HttpProxyUser- See Also:
- Constant Field Values
-
HttpProxyPass
private static final int HttpProxyPass
Field HttpProxyPass- See Also:
- Constant Field Values
-
HttpBasicUser
private static final int HttpBasicUser
Field HttpProxyUser- See Also:
- Constant Field Values
-
HttpBasicPass
private static final int HttpBasicPass
Field HttpProxyPass- See Also:
- Constant Field Values
-
-
Method Detail
-
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
private java.net.URLConnection openConnection(java.net.URL url) throws java.io.IOException
- Throws:
java.io.IOException
-
engineCanResolveURI
public boolean engineCanResolveURI(ResourceResolverContext context)
We resolve http URIs without fragment...- Specified by:
engineCanResolveURI
in classResourceResolverSpi
- Parameters:
context
-- Returns:
- true if can be resolved
-
engineGetPropertyKeys
public java.lang.String[] engineGetPropertyKeys()
Method engineGetPropertyKeys- Overrides:
engineGetPropertyKeys
in classResourceResolverSpi
- Returns:
- the property keys
-
getNewURI
private static java.net.URI getNewURI(java.lang.String uri, java.lang.String baseURI) throws java.net.URISyntaxException
- Throws:
java.net.URISyntaxException
-
-