Forums Register Login
ur opinion on this...
I am developing an Application which is dependent on some
PATHS which i am using as String variables.These PATHS are needed for file creation and other purposes.
I need some ideas as to how can i change these PATHS without recompiling the code and use the same application on other system.
One way I can do is have a text file in which I can set these PATHS and read from that file. But is this the feasible solution?
All of your views are welcome.
Thanks in advance,
You can use properties file in java which stores information in the form of key-vlaue pairs.
any changes done on the file do not require recompilation of code.
properties files are custom built to hold such information.
Commandline options are another possibility.
or if not command line, simply use txt files to hold the paths.
Thanks Kishore ,Jeroen and Antoine ofr spending ur valuable time.
And command line idea is not at all feasible for me as I can have many such parameters.
So now shall I consider that maintaining text file is the best option?
If so,
then in future if i need some info to be in these files which should be secure, eg.Database Username-Password,will it be feasible then...
Taking your valuble time but my problem is genuine...
Thanks again,
any ideas........?
how can I handle such a file in a secure way ....
or any other way to handle the sensitive data...like passwords,usernames..
thanks in advance,
you could make a simple encryption/decryption algorithm in your program. its a more basic solution but as long as the userid etc were not legible to people who ahve access to the text file, i cannot see any issues.
If you want platform independence, then you should externalize platform dependent data into properties files or XML or something like that.
Your application should not store sensitive data like usernames and passwords in these files. If you want a secure application, use authentication and authorization supported by Java. You'll have to have the user log in as their using your application--there's no other way. Think about it...what if linux or Windows didn't force you to log in to use the OS and just let you store your authentication parameters in a text file. What's to stop anyone else from walking up and using your login?
Unfortunately, there's no shortcut to security.
His brain is the size of a cherry pit! About the size of this ad:
ScroogeXHTML 7.1 - RTF to HTML5 / XHTML converter

This thread has been viewed 758 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 21, 2018 15:36:09.