Class ProblemFileManager

java.lang.Object
com.decs.application.utils.confFile.ProblemFileManager

public class ProblemFileManager extends Object
Problem File Manager Class

This class manages the files related with each available problem.

Version:
1.0
Author:
Bruno Guiomar
  • Constructor Details

    • ProblemFileManager

      public ProblemFileManager()
      Default Class Constructor
  • Method Details

    • getProblemList

      public static ArrayList<HashMap<FileConfigAttr,String>> getProblemList(String path)
      Constructs and retrieves all available problems. This method searches for problem configuration files (.conf).
      Parameters:
      path - Path of the root problem folder
      Returns:
      List of all available problems
    • writeConfFile

      public static void writeConfFile(File path, HashMap<FileConfigAttr,String> problemInfo)
      Writes problem configuration file (.conf) with the specified information
      Parameters:
      path - Destination path for the file
      problemInfo - Hashmap with the file contents
    • createFile

      public static void createFile()
      Utility method to manually create problem configuration files
    • getFilesInFolder

      public static ArrayList<File> getFilesInFolder(File rootFolder)
      Parameters:
      rootFolder - Root folder
      Returns:
      List of all files inside the root folder
    • getFileNamesInFolder

      public static ArrayList<String> getFileNamesInFolder(File rootFolder)
      Parameters:
      rootFolder - Root folder
      Returns:
      List of all file names inside the root folder
    • replaceFileContent

      public static void replaceFileContent(String filePath, String content)
      Replaces the textual content of a file
      Parameters:
      filePath - Path of the file
      content - New textual content
    • extractMap

      private static HashMap<FileConfigAttr,String> extractMap(File confFile)
      Extract all information from a problem configuration file (.conf)
      Parameters:
      confFile - Problem configuration file
      Returns:
      Hashmap with the file contents