Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean isAuthenticated(String username, String password) throws FileNotFoundException{
- boolean status = true;
- File file = new File("");
- Scanner scan = new Scanner(file);
- List<Login> login = new ArrayList<Login>();
- while(scan.hasNextLine()){
- String line = scan.nextLine();
- String [] details = line.split(":");
- String storedUsername = details[0];
- String storedPassword = details[1];
- Login l = new Login(username, password);
- if(storedUsername.equals(username)&& storedPassword.equals(password)){
- status = true;
- }else{
- status = false;
- }
- }
- return status;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement