File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
vrml-resource/src/main/java/group/rxcloud/vrml/resource Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,8 @@ final class JavaFileLoader {
22
22
*/
23
23
static InputStreamReader loadJavaResources (String fileName ) throws NullPointerException , IllegalArgumentException {
24
24
Objects .requireNonNull (fileName , "fileName not found." );
25
- try (InputStream in = JavaFileLoader .class .getResourceAsStream (fileName )) {
26
- return new InputStreamReader (in , StandardCharsets .UTF_8 );
27
- } catch (Exception e ) {
28
- throw new IllegalArgumentException (fileName + " file not found." , e );
29
- }
25
+ InputStream in = JavaFileLoader .class .getResourceAsStream (fileName );
26
+ return new InputStreamReader (in , StandardCharsets .UTF_8 );
30
27
}
31
28
32
29
/**
@@ -42,9 +39,8 @@ static InputStreamReader loadSystemFile(String fileName) throws NullPointerExcep
42
39
try {
43
40
File file = new File (fileName );
44
41
if (file .exists () && file .canRead ()) {
45
- try (FileInputStream fis = new FileInputStream (file )) {
46
- return new InputStreamReader (fis , StandardCharsets .UTF_8 );
47
- }
42
+ FileInputStream fis = new FileInputStream (file );
43
+ return new InputStreamReader (fis , StandardCharsets .UTF_8 );
48
44
}
49
45
} catch (Exception e ) {
50
46
throw new IllegalArgumentException (fileName + " file not found." , e );
You can’t perform that action at this time.
0 commit comments