No, you do not need to hide the spaces.
If the code raises a FileNotFoundException
, then the file does not exist (or perhaps you do not need the necessary permissions to access it).
If the permissions are right, and you think the file exists, make sure that it calls what you think it called. In particular, ensure that the file name does not contain any non-printable characters, unintended leading or trailing spaces, etc. ls -b
may be useful for this.
source share