org.xson.web.util.Resources Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xco-web Show documentation
Show all versions of xco-web Show documentation
xco-web is an easy to use control layer framework, is part of the SOA system, using xml language to describe the controller.
The newest version!
package org.xson.web.util;
import java.io.IOException;
import java.io.InputStream;
import org.xson.web.Container;
public class Resources {
public static InputStream getResourceAsStream(String resource) throws IOException {
return getResourceAsStream(Container.class.getClassLoader(), resource);
}
public static InputStream getResourceAsStream(ClassLoader loader, String resource) throws IOException {
if (null == loader) {
loader = Container.class.getClassLoader();
}
InputStream returnValue = loader.getResourceAsStream(resource);
if (null == returnValue) {
returnValue = loader.getResourceAsStream("/" + resource);
}
if (null != returnValue) {
return returnValue;
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy