org.jclarion.clarion.file.ResourceClarionFile Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clarion-runtime Show documentation
Show all versions of clarion-runtime Show documentation
JClarion runtime environment
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