diff options
Diffstat (limited to 'bundles/org.eclipse.wst.ws.ui/src/org/eclipse/wst/ws/internal/ui/utils/AdapterUtils.java')
-rw-r--r-- | bundles/org.eclipse.wst.ws.ui/src/org/eclipse/wst/ws/internal/ui/utils/AdapterUtils.java | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/bundles/org.eclipse.wst.ws.ui/src/org/eclipse/wst/ws/internal/ui/utils/AdapterUtils.java b/bundles/org.eclipse.wst.ws.ui/src/org/eclipse/wst/ws/internal/ui/utils/AdapterUtils.java deleted file mode 100644 index 697df2189..000000000 --- a/bundles/org.eclipse.wst.ws.ui/src/org/eclipse/wst/ws/internal/ui/utils/AdapterUtils.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20070327 172339 kathy@ca.ibm.com - Kathy Chan - * 20070716 191357 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ -package org.eclipse.wst.ws.internal.ui.utils; - -import java.net.URI; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.Platform; - -/** - * The AdapterUtils class provides utility methods to get objects from the Platform's adapter extension. - * - */ -public class AdapterUtils { - - /** - * @param object Object to adapt - * @return The adapted object representing the file or String if an adapter is found. - * Returns null if an adapter is not found. - */ - public static Object getAdaptedObject (Object object) { - if (object == null) - return null; - Object adaptedObject = Platform.getAdapterManager().loadAdapter(object, "org.eclipse.core.resources.IFile"); - if (adaptedObject == null) { - adaptedObject = Platform.getAdapterManager().loadAdapter(object, "java.lang.String"); - } - return adaptedObject; - } - - /** - * @param object Look up an adapter mapping the object to IFile or String. - * @return The WSDL uri returned by the adapter or null if no adapter is found. - */ - public static String getAdaptedWSDL (Object object) { - String wsdlURI = null; - Object adaptedObject = AdapterUtils.getAdaptedObject(object); - if ( adaptedObject != null) { - if (adaptedObject instanceof IFile) - { - URI uri = ((IFile)adaptedObject).getLocationURI(); - if (uri != null) { - wsdlURI = uri.toString(); - } - - } else if (adaptedObject instanceof String) { - wsdlURI = (String) adaptedObject; - } - } - return wsdlURI; - } - -} |