<..java.io.InputStream getInputStream( filename )..>
private java.io.InputStream getInputStream(
String filename )
throws java.io.IOException{
if( filename == null ){ return null; }
URL url;
java.io.InputStream inputStream = null;
// String loadingError = "Failed to get requested file.";
try {
url = new File(filename).toURI().toURL();
inputStream = getInputStream( url );
} catch (Exception ie) {
try {
url = new URL(filename);
inputStream = getInputStream( url );
} catch (java.io.FileNotFoundException ife) {
throw new java.io.IOException(
"File not found: " + filename);
} catch (Exception ife) {
throw new java.io.IOException(ife + "\n" + ie);
} }
return inputStream;
}
-_-_-