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

org.jclarion.clarion.file.ResourceClarionFile Maven / Gradle / Ivy

There is a newer version: 1.86
Show newest version
package org.jclarion.clarion.file;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class ResourceClarionFile extends RingBufferedInputStreamClarionFile
{
	private String name;
	public ResourceClarionFile(String name)
	{
		this.name=name;
	}
	
	
	@Override
	protected InputStream createStream() throws IOException {
		InputStream is = getClass().getClassLoader().getResourceAsStream(name);
		if (is==null) {
			is=ClassLoader.getSystemClassLoader().getResourceAsStream(name);
		}
		if (is==null) throw new FileNotFoundException(name);
		return is;
	}

	@Override
	public String getName() {
		return name;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy