5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * The contents of this file are subject to the terms
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * of the Common Development and Distribution License
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * (the License). You may not use this file except in
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * compliance with the License.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * You can obtain a copy of the License at
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * See the License for the specific language governing
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * permission and limitations under the License.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * When distributing Covered Code, include this CDDL
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * Header Notice in each file and include the License file
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * If applicable, add the following below the CDDL Header,
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * with the fields enclosed by brackets [] replaced by
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * your own identifying information:
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * $Id: AMURLStreamHandlerFactory.java,v 1.2 2008/06/25 05:52:56 qcheng Exp $
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Fosterimport com.sun.identity.shared.configuration.SystemPropertiesManager;
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * This class provides method to return configured https protocol handler.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Fosterpublic class AMURLStreamHandlerFactory implements URLStreamHandlerFactory {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster static private Debug debug = Debug.getInstance("amComm");
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster SystemPropertiesManager.get(Constants.PROTOCOL_HANDLER, null);
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster prot_handler_string = prot_handler_string + ".https.Handler";
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster debug.message("Configured Protocol Handler : " +
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * Returns configured https protocol handler.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @param protocol - the protocol ("https")
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster * @return a <code>URLStreamHandler</code> for https protocol.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster public URLStreamHandler createURLStreamHandler(String protocol) {
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster String method = "AMURLStreamHandlerFactory.createURLStreamHandler ";
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster prot_handler = (URLStreamHandler) Class.forName(
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster "Failed to find protocol handler class ", e);
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster "Failed to instantiate protocol handler class ", e);
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster "Invalid access for protocol handler class ", e);