public void readFile(String filename) throws FileNotFoundException, IOException, InvalidUserException {
        Scanner scanner = new Scanner(new File(filename));
        fw = new FileWriter(new File(fileWriterName));

        while (true) {
            String s = scanner.nextLine();
            if (s.contains("EXIT")) {
                break;
            } else {
                try {
                    writeToFile(s);
                } catch (InvalidMailFormatException |
                        InvalidEditProfileInputException |
                        InvalidPhoneNrFormatException |
                        ProfileNotSetException ex) {
                    Logger.getLogger(Twitter.class
                            .getName()).log(Level.SEVERE, null, ex);
                }
            }

        }
        fw.flush();
        fw.close();

    }