use of com.notnoop.exceptions.RuntimeIOException in project camel by apache.
the class ResourceUtils method getInputStream.
public static InputStream getInputStream(String path) {
InputStream is = null;
if (isClasspathResource(path)) {
String classpathResourcePath = ResourceUtils.getClasspathResourcePath(path);
is = ResourceUtils.class.getResourceAsStream(classpathResourcePath);
if (is == null) {
throw new RuntimeIOException("Certificate stream is null: '" + classpathResourcePath + "'");
}
} else {
try {
is = IOHelper.buffered(new FileInputStream(path));
} catch (FileNotFoundException e) {
throw new RuntimeIOException(e);
}
}
return is;
}
Aggregations