Class ProblemFileManager
java.lang.Object
com.decs.application.utils.confFile.ProblemFileManager
Problem File Manager Class
This class manages the files related with each available problem.
- Version:
- 1.0
- Author:
- Bruno Guiomar
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidUtility method to manually create problem configuration filesprivate static HashMap<FileConfigAttr, String> extractMap(File confFile) Extract all information from a problem configuration file (.conf)getFileNamesInFolder(File rootFolder) getFilesInFolder(File rootFolder) static ArrayList<HashMap<FileConfigAttr, String>> getProblemList(String path) Constructs and retrieves all available problems.static voidreplaceFileContent(String filePath, String content) Replaces the textual content of a filestatic voidwriteConfFile(File path, HashMap<FileConfigAttr, String> problemInfo) Writes problem configuration file (.conf) with the specified information
-
Constructor Details
-
ProblemFileManager
public ProblemFileManager()Default Class Constructor
-
-
Method Details
-
getProblemList
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
Writes problem configuration file (.conf) with the specified information- Parameters:
path- Destination path for the fileproblemInfo- Hashmap with the file contents
-
createFile
public static void createFile()Utility method to manually create problem configuration files -
getFilesInFolder
- Parameters:
rootFolder- Root folder- Returns:
- List of all files inside the root folder
-
getFileNamesInFolder
- Parameters:
rootFolder- Root folder- Returns:
- List of all file names inside the root folder
-
replaceFileContent
Replaces the textual content of a file- Parameters:
filePath- Path of the filecontent- New textual content
-
extractMap
Extract all information from a problem configuration file (.conf)- Parameters:
confFile- Problem configuration file- Returns:
- Hashmap with the file contents
-