1 /******************************************************************************* 2 * Copyright (c) 2000, 2006 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.update.internal.configurator; 12 13 import java.io.IOException; 14 import java.net.URL; 15 16 import org.eclipse.update.configurator.IPlatformConfiguration; 17 import org.eclipse.update.configurator.IPlatformConfigurationFactory; 18 19 public class PlatformConfigurationFactory implements IPlatformConfigurationFactory { 20 public IPlatformConfiguration getCurrentPlatformConfiguration() { 21 return PlatformConfiguration.getCurrent(); 22 } 23 public IPlatformConfiguration getPlatformConfiguration(URL url) throws IOException { 24 try { 25 return new PlatformConfiguration(url); 26 } catch (Exception e) { 27 if (e instanceof IOException) 28 throw (IOException)e; 29 throw new IOException(e.getMessage()); 30 } 31 } 32 } 33