Java Resource Load getResourceStream(final String resourcePath)

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

Description

Gets the InputStream of a local resource.

License

Open Source License

Parameter

Parameter Description
resourcePath the path of the local resource.

Return

the for reading the local resource

Declaration

public static InputStream getResourceStream(final String resourcePath) 

Method Source Code


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

import java.io.InputStream;

public class Main {
    /**/* ww w.  jav a2s  . com*/
     * Gets the {@link InputStream} of a local resource.
     *
     * @param resourcePath the path of the local resource.
     * @return the {@link InputStream} for reading the local resource
     */
    public static InputStream getResourceStream(final String resourcePath) {
        return ClassLoader.class.getResourceAsStream(resourcePath);
    }
}

Related

  1. getResourcesFromJarFile(final File file, final Pattern pattern)
  2. getResourcesFromZip(final byte[] barContent)
  3. getResourceSize(ClassLoader classLoader, String path)
  4. getResourceStream(Class clazz, String resourceName)
  5. getResourceStream(final String resource)
  6. getResourceStream(String className, ClassLoader classLoader)
  7. getResourceStream(String name)
  8. getResourceStream(String pathToResource)
  9. getResourceStream(String resource, Class root)