All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jscep.transport.UrlConnectionTransportFactory Maven / Gradle / Ivy

There is a newer version: 2.5.6
Show newest version
package org.jscep.transport;

import javax.net.ssl.SSLSocketFactory;
import java.net.URL;

public class UrlConnectionTransportFactory implements TransportFactory {

    private SSLSocketFactory sslSocketFactory;

    public UrlConnectionTransportFactory(){}

    public UrlConnectionTransportFactory(SSLSocketFactory sslSocketFactory){
        this.sslSocketFactory = sslSocketFactory;
    }

    @Override
    public Transport forMethod(Method method, URL url) {
        if (method == Method.GET) {
            return new UrlConnectionGetTransport(url, sslSocketFactory);
        } else {
            return new UrlConnectionPostTransport(url, sslSocketFactory);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy