I want to access files in a directory with spaces in the file name from a java program, but it does not have access to the file.
Scenario: I have file names in a file. iread file names are from this file and cannot open files with spaces in java.
We use the File.exist function to check if a file exists, but it returns false.
I tried several formats for representing spaces, like "ab \ c" for the file name ab c and ab% 20c for the same file.
but nothing helps.
java file operating-system
Gaurav
source share