me.aifaq.commons.lang.IOUtil Maven / Gradle / Ivy
package me.aifaq.commons.lang;
import java.io.InputStream;
/**
* @author Wang Wei [[email protected]]
* @since 10:58 2017/12/4
*/
public class IOUtil {
public static InputStream getResourceAsStream(String path) {
return getResourceAsStream(path, null);
}
public static InputStream getResourceAsStream(String path, Class> clazz) {
if (clazz == null) {
clazz = IOUtil.class;
}
InputStream is = clazz.getResourceAsStream(path);
if (is != null) {
return is;
}
return ClassLoader.getSystemResourceAsStream(path);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy