private void removeLine(String line){
        try {

          if (!usr.isFile()) {
            System.out.println("Parameter is not an existing file");
            return;
          }

          //Construct the new file that will later be renamed to the original filename.
          File tempFile = new File(usr.getAbsolutePath() + ".tmp");

          BufferedReader br = new BufferedReader(new FileReader(usr));
          PrintWriter pw = new PrintWriter(new FileWriter(tempFile));

          String lin = null;

          //Read from the original file and write to the new
          //unless content matches data to be removed.
          while ((lin = br.readLine()) != null) {

            if(!isContain(lin.trim(),line)){ //if it contains the username and exactly the username
              pw.println(lin);
              pw.flush();
            }
          }
          pw.close();
          br.close();

          //Delete the original file
          usr.delete();

          //Rename the new file to the filename the original file had.
          if (!tempFile.renameTo(usr))
            c.chat.sendMessage("Error occured");

        }catch (IOException e) {
            e.printStackTrace();
        }
      }