Tuesday, 15 February 2011

Java CentOs File path with special characters and spaces FileNotFound -



Java CentOs File path with special characters and spaces FileNotFound -

i'm having problem accessing files in java. altough files loaded of filesystem using folder.listfiles() etc...

the problem have files have special characters , spaces.

example:

/test folder/subtestfolder/>> file.txt

i think java translates to:

'/test folder/subtestfolder/?? file.txt'

to pass centos. because there spaces , special characters theres no analyzing on ??. is possible forcefulness utilize >> or encode it?

this error library use:

java.io.filenotfoundexception: /test folder/subtestfolder/?? file.txt(no such file or directory) @ java.io.fileinputstream.open(native method)...

the java scheme property file.encoding should match console's character encoding. property must set when starting java on command-line:

java -dfile.encoding=utf-8 …

java centos

No comments:

Post a Comment