Class FileHandleUtil

java.lang.Object
FileHandleUtil

public final class FileHandleUtil extends Object
  • Method Details

    • getInstance

      public static FileHandleUtil getInstance()
    • readScores

      public List<Score> readScores() throws IOException
      reads all scores from file
      Returns:
      scores sorted by rank
      Throws:
      IOException
    • readLatestScores

      public List<Score> readLatestScores() throws IOException
      reads all scores from file
      Returns:
      scores sorted by datetime
      Throws:
      IOException
    • addScore

      public void addScore(Score score) throws IOException
      adds a score, reorganizes the rank ids and writes to file
      Parameters:
      score -
      Throws:
      IOException
    • deleteFile

      public boolean deleteFile()
      delete savefile
      Returns:
      boolean if file deleted
    • createFile

      public void createFile() throws IOException
      Throws:
      IOException