public InputStream fetchInputStream(String filePath) {
InputStream inputStream = this.getClass().getResourceAsStream(filePath);
if (inputStream == null) {
File file = null;
file = new File(filePath);
try {
inputStream = new FileInputStream(file);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
return inputStream;
}
InputStream inputStream = this.getClass().getResourceAsStream(filePath);
if (inputStream == null) {
File file = null;
file = new File(filePath);
try {
inputStream = new FileInputStream(file);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
return inputStream;
}
No comments:
Post a Comment