com.github.xionghuicoder.helpers.LoaderHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eslf4j Show documentation
Show all versions of eslf4j Show documentation
Expand simple logging facade for java
The newest version!
package com.github.xionghuicoder.helpers;
import java.net.URL;
/**
* 资源加载
*
* @author xionghui
* @version 1.0.0
* @since 1.0.0
*/
public class LoaderHelper {
public static URL getResource(String resource) {
ClassLoader classLoader = LoaderHelper.class.getClassLoader();
LogHelper.debug("Trying to find [" + resource + "] using " + classLoader + " class loader.");
URL url = classLoader.getResource(resource);
if (url != null) {
return url;
}
LogHelper.debug("Trying to find [" + resource + "] using ClassLoader.getSystemResource().");
return ClassLoader.getSystemResource(resource);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy