Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FileInputStream is Null?

Tags:

java

file

file-io

Okay, so this is the line that's returning null. What am I doing wrong while creating this FileInputStream?

FileInputStream fin = new FileInputStream(new File(getClass().getResource("data/levellocks.lv").toURI()));
like image 576
William Avatar asked Sep 30 '26 03:09

William


1 Answers

The only thing that can be null there is getResource("data/levellocks.lv") which is calling the toURI call to fail

like image 132
willcodejavaforfood Avatar answered Oct 01 '26 18:10

willcodejavaforfood