Java Resource Load getResourceUrl(final String resourcePath)

Here you can find the source of getResourceUrl(final String resourcePath)

Description

Gets the URL of a local resource.

License

Open Source License

Parameter

Parameter Description
resourcePath the path of the local resource.

Return

the of the local resource.

Declaration

public static URL getResourceUrl(final String resourcePath) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.net.URL;

public class Main {
    /**//from ww w . j  av a  2  s .  c  om
     * Gets the {@link URL} of a local resource.
     *
     * @param resourcePath the path of the local resource.
     * @return the {@link URL} of the local resource.
     */
    public static URL getResourceUrl(final String resourcePath) {
        return ClassLoader.class.getResource(resourcePath);
    }
}

Related

  1. getResourceStreamFromClasspath(Class clazz, String resourceName)
  2. getResourceStreamInPackage(Class clazz, String name)
  3. getResourceString(String filename)
  4. getResourceUri(final String packageToScan, final ClassLoader classLoader)
  5. getResourceUrl(final Class aClass, final String aPath)
  6. getResourceUrl(String path, String extension, ClassLoader loader)
  7. getResourceURL(String resourcePath)
  8. getResourceUrl(String resourcePath)
  9. getResourceUsingFileStreams(InputStream source)