01: package com.sun.portal.netlet.client.jnlp.connect;
02:
03: import java.net.*;
04: import com.sun.portal.log.common.PortalLogger;
05:
06: public class ConnectionFactory {
07: public static ProtocolHandlerI getHandler(String scheme,
08: String httpVersion) throws MalformedURLException {
09: if (httpVersion == null || scheme == null)
10: throw new MalformedURLException("Version Unknown");
11:
12: if (scheme.equals("CONNECT")) {
13: //og.message("Scheme is CONNECT" );
14: return new HTTPS_Handler();
15: } else {
16: if (httpVersion.equals(Constants.HTTP_1_0))
17: return new HTTP_1_0_Handler();
18: else if (httpVersion.equals(Constants.HTTP_1_1))
19: return new HTTP_1_0_Handler();
20: else
21: throw new MalformedURLException("Version Unknown");
22: }
23: }
24: }
|