/** * Lazily registers the protocol with the given id. * * @param id the protocol ID * * @return the lazily registered protocol * * @throws IllegalStateException if the protocol with id is not recognized */ private static Protocol lazyRegisterProtocol(String id) throws IllegalStateException { if ("http".equals(id)) { final Protocol http = new Protocol("http", DefaultProtocolSocketFactory.getSocketFactory(), 80); Protocol.registerProtocol("http", http); return http; } if ("https".equals(id)) { final Protocol https = new Protocol("https", SSLProtocolSocketFactory.getSocketFactory(), 443); Protocol.registerProtocol("https", https); return https; } throw new IllegalStateException("unsupported protocol: '" + id + "'"); }
/** * Lazily registers the protocol with the given id. * * @param id the protocol ID * * @return the lazily registered protocol * * @throws IllegalStateException if the protocol with id is not recognized */ private static Protocol lazyRegisterProtocol(String id) throws IllegalStateException { if ("http".equals(id)) { final Protocol http = new Protocol("http", DefaultProtocolSocketFactory.getSocketFactory(), 80); Protocol.registerProtocol("http", http); return http; } if ("https".equals(id)) { final Protocol https = new Protocol("https", SSLProtocolSocketFactory.getSocketFactory(), 443); Protocol.registerProtocol("https", https); return https; } throw new IllegalStateException("unsupported protocol: '" + id + "'"); }
/** * Lazily registers the protocol with the given id. * * @param id the protocol ID * * @return the lazily registered protocol * * @throws IllegalStateException if the protocol with id is not recognized */ private static Protocol lazyRegisterProtocol(String id) throws IllegalStateException { if ("http".equals(id)) { final Protocol http = new Protocol("http", DefaultProtocolSocketFactory.getSocketFactory(), 80); Protocol.registerProtocol("http", http); return http; } if ("https".equals(id)) { final Protocol https = new Protocol("https", SSLProtocolSocketFactory.getSocketFactory(), 443); Protocol.registerProtocol("https", https); return https; } throw new IllegalStateException("unsupported protocol: '" + id + "'"); }
/** * Lazily registers the protocol with the given id. * * @param id the protocol ID * * @return the lazily registered protocol * * @throws IllegalStateException if the protocol with id is not recognized */ private static Protocol lazyRegisterProtocol(String id) throws IllegalStateException { if ("http".equals(id)) { final Protocol http = new Protocol("http", DefaultProtocolSocketFactory.getSocketFactory(), 80); Protocol.registerProtocol("http", http); return http; } if ("https".equals(id)) { final Protocol https = new Protocol("https", SSLProtocolSocketFactory.getSocketFactory(), 443); Protocol.registerProtocol("https", https); return https; } throw new IllegalStateException("unsupported protocol: '" + id + "'"); }
/** * Lazily registers the protocol with the given id. * * @param id the protocol ID * * @return the lazily registered protocol * * @throws IllegalStateException if the protocol with id is not recognized */ private static Protocol lazyRegisterProtocol(String id) throws IllegalStateException { if ("http".equals(id)) { final Protocol http = new Protocol("http", DefaultProtocolSocketFactory.getSocketFactory(), 80); Protocol.registerProtocol("http", http); return http; } if ("https".equals(id)) { final Protocol https = new Protocol("https", SSLProtocolSocketFactory.getSocketFactory(), 443); Protocol.registerProtocol("https", https); return https; } throw new IllegalStateException("unsupported protocol: '" + id + "'"); }