This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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 Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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: 10747
    
    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: 3042
    
    9

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


K. Tsang JavaRanch SCJP5 SCJD OCPJP7 OCPWCD5 OCPBCD5 OCPWSD5 OCMJEA5 part 1 part 2/3
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 44518
    
  34
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?
 
It's not a secret anymore!