Java URL Resolve resolvePlatformUrl(String urlspec)

Here you can find the source of resolvePlatformUrl(String urlspec)

Description

resolve Platform Url

License

Open Source License

Declaration

protected static String resolvePlatformUrl(String urlspec) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2004, 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:// ww  w  . j av a  2s  .  c  o  m
 * IBM Corporation - initial API and implementation
 * yyyymmdd bug      Email and other contact information
 * -------- -------- -----------------------------------------------------------
 *     IBM Corporation - Initial API and implementation
 *     Jens Lukowski/Innoopract - initial renaming/restructuring
 * 20071205   211262 ericdp@ca.ibm.com - Eric Peters, CopyWSDLTreeCommand fails to copy ?wsdl
 *******************************************************************************/

import java.net.URL;

import org.eclipse.core.runtime.FileLocator;

public class Main {
    protected static String resolvePlatformUrl(String urlspec) {
        String result = null;
        try {
            urlspec = urlspec.replace('\\', '/');
            URL url = new URL(urlspec);
            URL resolvedURL = FileLocator.resolve(url);
            result = resolvedURL.toString();
        } catch (Exception e) {
        }
        return result;
    }
}

Related

  1. resolve(URL base, String relUrl)
  2. resolve(URL base, String uri)
  3. resolveGoogleRedirect(String url)
  4. resolveHref(String baseUrl, String href)
  5. resolveManifestResources(final URL manifestUrl, final List resources)
  6. resolveRelativeURL(final URL primaryUrl, final String relativeLoc)
  7. resolveRelativeURL(String contextUri, String relativeUri)
  8. resolveResourceAsURL(Class clazz, String name)
  9. resolveResourceURL(Class base, String resource)