BicepBuddyApp/src/main/java/User/UserDB.java
public boolean login(String email, String pass) {
		try {
			BufferedReader buf = new BufferedReader(new FileReader(new File(filename)));
			String lineContent;
			
			while((lineContent = buf.readLine()) != null) {
				String[] split = lineContent.split(",");
				
				if(split[0].contentEquals(email)) {
					if(split[1].contentEquals(pass)) {
						UserController.setUserFromDB(split);
						buf.close();
						return true;
					}
					Master.appLogger.info(":: User's password was invalid.");
				}
			}
			
			buf.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		
		new ErrorGUI("Please enter valid username and password.");
		return false;
	}
/**
	 * Login.
	 *
	 * @param email the email of the User logging in
	 * @param pass the password of the User logging in
	 * @return true, if login was successful
	 */
Login.
@param email the email of the User logging in
@param pass the password of the User logging in
@return true, if login was successful
Login . @param email the email of the User logging in @param pass the password of the User logging in @return true if login was successful
public boolean login(String email, String pass) {
		try {
			BufferedReader buf = new BufferedReader(new FileReader(new File(filename)));
			String lineContent;
			while((lineContent = buf.readLine()) != null) {
				String[] split = lineContent.split(",");
				if(split[0].contentEquals(email)) {
					if(split[1].contentEquals(pass)) {
						UserController.setUserFromDB(split);
						buf.close();
						return true;
					}
					Master.appLogger.info(":: User's password was invalid.");
				}
			}
			buf.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		new ErrorGUI("Please enter valid username and password.");
		return false;
	}
public boolean login ( String email , String pass ) { try { BufferedReader buf = new BufferedReader ( new FileReader ( new File ( filename ) ) ) ; String lineContent ; while ( ( lineContent = buf . readLine ( ) ) != null ) { String [ ] split = lineContent . split ( "," ) ; if ( split [ 0 ] . contentEquals ( email ) ) { if ( split [ 1 ] . contentEquals ( pass ) ) { UserController . setUserFromDB ( split ) ; buf . close ( ) ; return true ; } Master . appLogger . info ( ":: User's password was invalid." ) ; } } buf . close ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } new ErrorGUI ( "Please enter valid username and password." ) ; return false ; }
Login.
Login .