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

org.xson.web.util.Resources Maven / Gradle / Ivy

Go to download

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