A standalone application for windows and Linux environment
While I use the windows environment, The file system will be like c: \ file \ abc \ xyz \ sample.txt linux environment file system /home/qa/file/abc/xyz/sample.txt
abc and xyz will be the name of the folders The user depends on the click. (ABC country code is folder) & amp; (Xyz Language Folders)
To create a path I use properties like
base_path: / home / test / file / or c: \ test \ file \ file_name: sample.txt The path in the program is created:
string path = base_path + countrycode + "/" + language_name + "/" + file_name "(" / "for Linux" )
Example for Linux:
/ home / test / file / spain / string path = base_path + country_code + "\" + language_name + "\" + file_name ("\" for window )
Example: Es / sample.txt
Example for Windows:
c: \ test \ file \ Italy \ it \ sample.txt
Country-Codes and Languages Each user will be different for PairAnames.
Every time I test the application with different environments im, the file separator should be "/" or "\" (windows and Linux). How do I code without changing the file separator?
(If I do not remember anything, then tell me I will update it) Thanks. / P>
You can see java.io.file.separatorchhar (public static final char) Can get a separator or string can be wrapped in the form of java.io.file.separator (public static final string) - "system-based default namespace character, represented as a string for convenience" . See:
Comments
Post a Comment