It's not a secret anymore!*
The moose likes Beginning Java and the fly likes My app uses a .txt file to retreive a list of usernames and passwords, can I jar it? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "My app uses a .txt file to retreive a list of usernames and passwords, can I jar it?" Watch "My app uses a .txt file to retreive a list of usernames and passwords, can I jar it?" New topic
Author

My app uses a .txt file to retreive a list of usernames and passwords, can I jar it?

Eric Larsen
Ranch Hand

Joined: Mar 28, 2009
Posts: 35
I will post the code for the classes if anyone needs to see it. Thanks in advance for the help.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10491
    
    9

Yes you can.
However, when you open a stream to the file to read the contents, you should be doing it using the getClass().getResource() method.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2564
    
    9

But then new users can't be added and existing users can't be removed.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5 OCPBCD5
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
And anybody who has a copy of the .jar can unzip it and read all the passwords.
salvin francis
Ranch Hand

Joined: Jan 12, 2009
Posts: 928

an out of the topic answer:

1. Do not store username and passwords in text file.
2. Store them in database.
3. If possible, hash the passwords before storing in database.


My Website: [Salvin.in] Cool your mind:[Salvin.in/painting] My Sally:[Salvin.in/sally]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: My app uses a .txt file to retreive a list of usernames and passwords, can I jar it?