Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static boolean nameExisted(User user, String path) throws FileNotFoundException, IOException {
- String name = user.getName();
- String pass = user.getPass();
- BufferedReader in = new BufferedReader(new FileReader(path));
- String line = in.readLine();
- while (line != null) {
- String[] te = line.split(" ");
- if (te[0].equals(name) && te[1].equals(pass)) {
- return true;
- }
- line = in.readLine();
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement