Advertisement
Guest User

Untitled

a guest
Apr 16th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. public boolean isAuthenticated(String username, String password) throws FileNotFoundException{
  2. boolean status = true;
  3. File file = new File("");
  4. Scanner scan = new Scanner(file);
  5.  
  6. List<Login> login = new ArrayList<Login>();
  7.  
  8. while(scan.hasNextLine()){
  9. String line = scan.nextLine();
  10. String [] details = line.split(":");
  11. String storedUsername = details[0];
  12. String storedPassword = details[1];
  13. Login l = new Login(username, password);
  14.  
  15. if(storedUsername.equals(username)&& storedPassword.equals(password)){
  16. status = true;
  17. }else{
  18. status = false;
  19. }
  20.  
  21. }
  22. return status;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement