Package org.apache.commons.httpclient.protocol

Examples of org.apache.commons.httpclient.protocol.ProtocolSocketFactory


        assertTrue(p2.equals(p1));
    }
   
    public void testProtocolSocketFactory() {
       
        ProtocolSocketFactory p1 = new DefaultProtocolSocketFactory();
        ProtocolSocketFactory p2 = new DefaultProtocolSocketFactory();

        assertTrue(p1.equals(p2));
        assertTrue(p2.equals(p1));

        p1 = new SSLProtocolSocketFactory();
        p2 = new SSLProtocolSocketFactory();

        assertTrue(p1.equals(p2));
        assertTrue(p2.equals(p1));
       
    }
View Full Code Here


        assertTrue(p2.equals(p1));
       
    }
   
    public void testProtocolSocketFactorySublass() {
        ProtocolSocketFactory factory1 = new DefaultProtocolSocketFactory();
        ProtocolSocketFactory factory2 = new DefaultProtocolSocketFactory() {};

        Protocol protocolA = new Protocol("http", factory1, 80);
        Protocol protocolB = new Protocol("http", factory2, 80);
        Protocol protocolC = new Protocol("http", factory2, 80);
View Full Code Here

        try {
            if (this.socket == null) {
                usingSecureSocket = isSecure() && !isProxied();
                // use the protocol's socket factory unless this is a secure
                // proxied connection
                ProtocolSocketFactory socketFactory = null;
                if (isSecure() && isProxied()) {
                    Protocol defaultprotocol = Protocol.getProtocol("http");
                    socketFactory = defaultprotocol.getSocketFactory();
                } else {
                    socketFactory = this.protocolInUse.getSocketFactory();
                }
                this.socket = socketFactory.createSocket(
                            host, port,
                            localAddress, 0,
                            this.params);
            }
View Full Code Here

        Trace.trace(Activator.PLUGIN_ID, "retrieve host=" + host + ";port=" + port); //$NON-NLS-1$ //$NON-NLS-2$
        hostConfiguration.setHost(host, port, sslProtocol);
        hostConfiguration.getParams().setParameter(CredentialsProvider.PROVIDER, credProvider);

      } else {
        ProtocolSocketFactory psf = new ECFHttpClientProtocolSocketFactory(SocketFactory.getDefault(), source, socketListener);
        Protocol protocol = new Protocol(HttpClientRetrieveFileTransfer.HTTP, psf, HTTP_PORT);
        Trace.trace(Activator.PLUGIN_ID, "retrieve host=" + host + ";port=" + port); //$NON-NLS-1$ //$NON-NLS-2$
        hostConfiguration.setHost(host, port, protocol);
        hostConfiguration.getParams().setParameter(CredentialsProvider.PROVIDER, credProvider);
      }
View Full Code Here

        assertTrue(p2.equals(p1));
    }
   
    public void testProtocolSocketFactory() {
       
        ProtocolSocketFactory p1 = new DefaultProtocolSocketFactory();
        ProtocolSocketFactory p2 = new DefaultProtocolSocketFactory();

        assertTrue(p1.equals(p2));
        assertTrue(p2.equals(p1));

        p1 = new SSLProtocolSocketFactory();
        p2 = new SSLProtocolSocketFactory();

        assertTrue(p1.equals(p2));
        assertTrue(p2.equals(p1));
       
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.protocol.ProtocolSocketFactory

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.