Throw exception instead of returning null if file can't be read.
This commit is contained in:
parent
fab316995a
commit
6d6f9ff341
1 changed files with 2 additions and 6 deletions
|
@ -54,12 +54,8 @@ public class FileResource extends AbstractResource {
|
||||||
return baseName;
|
return baseName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public InputStream getInputStream() {
|
public InputStream getInputStream() throws IOException {
|
||||||
try {
|
|
||||||
return new FileInputStream(file);
|
return new FileInputStream(file);
|
||||||
} catch (FileNotFoundException ex) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public URL getUrl() {
|
public URL getUrl() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue