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

net.sf.nakeduml.textmetamodel.ResourceLoader Maven / Gradle / Ivy

package net.sf.nakeduml.textmetamodel;
import java.io.InputStream;

import org.apache.velocity.exception.ResourceNotFoundException;
import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
/**
 * A workaround for a bug in the ClasspathResourceLoader. In Eclipse it
 * sometimes does not resolve a resource correctly
 */
public class ResourceLoader extends ClasspathResourceLoader {
	@Override
	public synchronized InputStream getResourceStream(String name) throws ResourceNotFoundException {
		InputStream is = super.getResourceStream(name);
		if (is == null && name != null) {
			is = getClass().getResourceAsStream(name);
		}
		return is;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy