All Downloads are FREE. Search and download functionalities are using the official Maven repository.

me.aifaq.commons.lang.IOUtil Maven / Gradle / Ivy

There is a newer version: 2.0.3
Show newest version
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