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;
|
||||
}
|
||||
|
||||
public InputStream getInputStream() {
|
||||
try {
|
||||
public InputStream getInputStream() throws IOException {
|
||||
return new FileInputStream(file);
|
||||
} catch (FileNotFoundException ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public URL getUrl() {
|
||||
|
|
Loading…
Add table
Reference in a new issue