Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.URI$CharsetChanged


        } catch (ParserConfigurationException e) {
            throw new RepositoryException(e);
        }

        try {
            URI repositoryUri = new URI((uri.endsWith("/")) ? uri : uri+"/", true);
            hostConfig = new HostConfiguration();
            hostConfig.setHost(repositoryUri);

            nsCache = new NamespaceCache();
            uriResolver = new URIResolverImpl(repositoryUri, this, domFactory);
View Full Code Here


    extends EntityEnclosingMethod {
    private String method = null;
    public ExtensionMethod(String method, String uri) {
      super(method);
      try {
        this.setURI(new URI(uri, false));
      } catch (Exception e) {}
      this.method = method;
    }
View Full Code Here

    private void httpProxy(
        final SimpleHttpServerConnection conn,
        final SimpleRequest request) throws IOException {

        RequestLine oldreqline = request.getRequestLine();
        URI uri = new URI(oldreqline.getUri(), true);
        SimpleHost host = new SimpleHost(uri.getHost(), uri.getPort());
        SimpleHttpServerConnection proxyconn = this.connmanager.openConnection(host);
        proxyconn.setSocketTimeout(0);
        try {

           
            // Rewrite target url
            RequestLine newreqline = new RequestLine(
                    oldreqline.getMethod(),
                    uri.getEscapedPath(),
                    oldreqline.getHttpVersion());
            request.setRequestLine(newreqline);
            // Remove proxy-auth headers if present
            request.removeHeaders("Proxy-Authorization");
            // Manage connection persistence
View Full Code Here

    }

    private HostConfiguration getHostConfiguration(String locationURI, MessageExchange exchange, NormalizedMessage message)
        throws Exception {
        HostConfiguration host;
        URI uri = new URI(locationURI, false);
        if (uri.getScheme().equals("https")) {
            synchronized (this) {
                if (protocol == null) {
                    ProtocolSocketFactory sf = new CommonsHttpSSLSocketFactory(
                                    endpoint.getSsl(),
                                    endpoint.getKeystoreManager());
                    protocol = new Protocol("https", sf, 443);
                }
            }
            HttpHost httphost = new HttpHost(uri.getHost(), uri.getPort(), protocol);
            host = new HostConfiguration();
            host.setHost(httphost);
        } else {
            host = new HostConfiguration();
            host.setHost(uri.getHost(), uri.getPort());
        }
        if (endpoint.getProxy() != null) {
            if ((endpoint.getProxy().getProxyHost() != null) && (endpoint.getProxy().getProxyPort() != 0)) {
                host.setProxy(endpoint.getProxy().getProxyHost(), endpoint.getProxy().getProxyPort());
            }
View Full Code Here

   */
  public boolean processRequest(SimpleHttpServerConnection conn) throws IOException {
    RequestLine line = conn.getRequestLine();
    String method = line.getMethod();
    if (!"CONNECT".equalsIgnoreCase(method)) return false;
    URI url = new HttpURL(line.getUri());
    handshake(conn, url);
    return true;
  }
View Full Code Here

  public boolean processRequest(SimpleHttpServerConnection conn) throws IOException {
    RequestLine line = conn.getRequestLine();
    String method = line.getMethod();
    //TODO add POST method handling
    if (!"GET".equalsIgnoreCase(method)) return false;
    URI url = new HttpURL(line.getUri());
    httpProxy(conn, url);
    return true;
  }
View Full Code Here

    private void httpProxy(
        final SimpleHttpServerConnection conn,
        final SimpleRequest request) throws IOException {

        RequestLine oldreqline = request.getRequestLine();
        URI uri = new URI(oldreqline.getUri(), true);
        SimpleHost host = new SimpleHost(uri.getHost(), uri.getPort());
        SimpleHttpServerConnection proxyconn = this.connmanager.openConnection(host);
        try {

           
            // Rewrite target url
            RequestLine newreqline = new RequestLine(
                    oldreqline.getMethod(),
                    uri.getEscapedPath(),
                    oldreqline.getHttpVersion());
            request.setRequestLine(newreqline);
            // Remove proxy-auth headers if present
            request.removeHeaders("Proxy-Authorization");
            // Manage connection persistence
View Full Code Here

    {
        RequestLine line = request.getRequestLine();
        String method = line.getMethod();
        if (!"CONNECT".equalsIgnoreCase(method))
            return false;
        URI url = new HttpURL(line.getUri());
        handshake(conn, url);
        return true;
    }
View Full Code Here

        } catch (ParserConfigurationException e) {
            throw new RepositoryException(e);
        }

        try {
            URI repositoryUri = new URI((uri.endsWith("/")) ? uri : uri+"/", true);
            hostConfig = new HostConfiguration();
            hostConfig.setHost(repositoryUri);

            nsCache = new NamespaceCache();
            uriResolver = new URIResolverImpl(repositoryUri, this, domFactory);
View Full Code Here

      }
    }
  }

  private static int httpNotification(String uri) throws IOException {
    URI url = new URI(uri, false);
    HttpClient m_client = new HttpClient();
    HttpMethod method = new GetMethod(url.getEscapedURI());
    method.setRequestHeader("Accept", "*/*");
    return m_client.executeMethod(method);
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.URI$CharsetChanged

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.