KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > internal > configurator > PlatformConfigurationFactory


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 JavaDoc;
14 import java.net.URL JavaDoc;
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 JavaDoc url) throws IOException JavaDoc {
24         try {
25             return new PlatformConfiguration(url);
26         } catch (Exception JavaDoc e) {
27             if (e instanceof IOException JavaDoc)
28                 throw (IOException JavaDoc)e;
29             throw new IOException JavaDoc(e.getMessage());
30         }
31     }
32 }
33
Popular Tags