Java Path to URL getURL(String path)

Here you can find the source of getURL(String path)

Description

get URL

License

Open Source License

Declaration

public static URL getURL(String path) 

Method Source Code

//package com.java2s;

import java.net.*;

public class Main {
    public static URL getURL(String path) {
        class ClassOnCurrentClassLoader {
        }//from  w ww  .j  av a2s  . c om
        ;
        Object c = new ClassOnCurrentClassLoader();
        return c.getClass().getResource(path); // it looks relative to the class.
        // return c.getClass().getClassLoader().getResource(path); // it looks in the top level directories of your class path.
    }
}

Related

  1. getURL(String aPath)
  2. getUrl(String baseUrl, String absPath)
  3. getURL(String host, int port, String path, boolean isHTTPS)
  4. getUrl(String inPath)
  5. getUrl(String ip, String port, String servicePath, String serviceName, String... args)
  6. getURL(String path)
  7. getURL(String path, URL context)
  8. getUrl(String pluginId, String relativePath)
  9. getURL(String schema, String host, String path)