aspose file tools*
The moose likes Java in General and the fly likes ur opinion on this... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "ur opinion on this..." Watch "ur opinion on this..." New topic
Author

ur opinion on this...

Yogesh Kodgule
Greenhorn

Joined: Oct 02, 2003
Posts: 29
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,
yogesh


"Thinking of doing something is also doing something ...so don't just stop thinking!"
kishore goswami
Greenhorn

Joined: Aug 13, 2003
Posts: 18
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.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
properties files are custom built to hold such information.
Commandline options are another possibility.


42
Antoine Waugh
Ranch Hand

Joined: Jan 24, 2004
Posts: 66
or if not command line, simply use txt files to hold the paths.


B.C.S.T, SCJP, Hero
Yogesh Kodgule
Greenhorn

Joined: Oct 02, 2003
Posts: 29
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,
Yogesh
Yogesh Kodgule
Greenhorn

Joined: Oct 02, 2003
Posts: 29
any ideas........?
suggesstions...
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,
yogesh
Antoine Waugh
Ranch Hand

Joined: Jan 24, 2004
Posts: 66
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.
twans
sever oon
Ranch Hand

Joined: Feb 08, 2004
Posts: 268
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.
sev
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ur opinion on this...