Java Resource Load getResourceStream(final String resource)

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

Description

get Resource Stream

License

Apache License

Declaration

public static InputStream getResourceStream(final String resource) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.InputStream;

public class Main {
    public static InputStream getResourceStream(final String resource) {
        return getClassLoader().getResourceAsStream(resource);
    }/*from ww  w.  ja va  2s. co m*/

    private static ClassLoader getClassLoader() {
        return Thread.currentThread().getContextClassLoader();
    }
}

Related

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