src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java

Print this page




  39 import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException;
  40 import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverSpi;
  41 
  42 /**
  43  * A simple ResourceResolver for HTTP requests. This class handles only 'pure'
  44  * HTTP URIs which means without a fragment. The Fragment handling is done by the
  45  * {@link ResolverFragment} class.
  46  * <BR>
  47  * If the user has a corporate HTTP proxy which is to be used, the usage can be
  48  * switched on by setting properties for the resolver:
  49  * <PRE>
  50  * resourceResolver.setProperty("http.proxy.host", "proxy.company.com");
  51  * resourceResolver.setProperty("http.proxy.port", "8080");
  52  *
  53  * // if we need a password for the proxy
  54  * resourceResolver.setProperty("http.proxy.username", "proxyuser3");
  55  * resourceResolver.setProperty("http.proxy.password", "secretca");
  56  * </PRE>
  57  *
  58  * @see <A HREF="http://www.javaworld.com/javaworld/javatips/jw-javatip42_p.html">Java Tip 42: Write Java apps that work with proxy-based firewalls</A>
  59  * @see <A HREF="http://java.sun.com/j2se/1.4/docs/guide/net/properties.html">SUN J2SE docs for network properties</A>
  60  * @see <A HREF="http://metalab.unc.edu/javafaq/javafaq.html#proxy">The JAVA FAQ Question 9.5: How do I make Java work with a proxy server?</A>
  61  */
  62 public class ResolverDirectHTTP extends ResourceResolverSpi {
  63 
  64     /** {@link org.apache.commons.logging} logging facility */
  65     private static java.util.logging.Logger log =
  66         java.util.logging.Logger.getLogger(ResolverDirectHTTP.class.getName());
  67 
  68     /** Field properties[] */
  69     private static final String properties[] = {
  70                                                  "http.proxy.host", "http.proxy.port",
  71                                                  "http.proxy.username", "http.proxy.password",
  72                                                  "http.basic.username", "http.basic.password"
  73                                                };
  74 
  75     /** Field HttpProxyHost */
  76     private static final int HttpProxyHost = 0;
  77 
  78     /** Field HttpProxyPort */
  79     private static final int HttpProxyPort = 1;




  39 import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException;
  40 import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverSpi;
  41 
  42 /**
  43  * A simple ResourceResolver for HTTP requests. This class handles only 'pure'
  44  * HTTP URIs which means without a fragment. The Fragment handling is done by the
  45  * {@link ResolverFragment} class.
  46  * <BR>
  47  * If the user has a corporate HTTP proxy which is to be used, the usage can be
  48  * switched on by setting properties for the resolver:
  49  * <PRE>
  50  * resourceResolver.setProperty("http.proxy.host", "proxy.company.com");
  51  * resourceResolver.setProperty("http.proxy.port", "8080");
  52  *
  53  * // if we need a password for the proxy
  54  * resourceResolver.setProperty("http.proxy.username", "proxyuser3");
  55  * resourceResolver.setProperty("http.proxy.password", "secretca");
  56  * </PRE>
  57  *
  58  * @see <A HREF="http://www.javaworld.com/javaworld/javatips/jw-javatip42_p.html">Java Tip 42: Write Java apps that work with proxy-based firewalls</A>
  59  * @see <A HREF="http://docs.oracle.com/javase/1.4.2/docs/guide/net/properties.html">SUN J2SE docs for network properties</A>
  60  * @see <A HREF="http://metalab.unc.edu/javafaq/javafaq.html#proxy">The JAVA FAQ Question 9.5: How do I make Java work with a proxy server?</A>
  61  */
  62 public class ResolverDirectHTTP extends ResourceResolverSpi {
  63 
  64     /** {@link org.apache.commons.logging} logging facility */
  65     private static java.util.logging.Logger log =
  66         java.util.logging.Logger.getLogger(ResolverDirectHTTP.class.getName());
  67 
  68     /** Field properties[] */
  69     private static final String properties[] = {
  70                                                  "http.proxy.host", "http.proxy.port",
  71                                                  "http.proxy.username", "http.proxy.password",
  72                                                  "http.basic.username", "http.basic.password"
  73                                                };
  74 
  75     /** Field HttpProxyHost */
  76     private static final int HttpProxyHost = 0;
  77 
  78     /** Field HttpProxyPort */
  79     private static final int HttpProxyPort = 1;