public class FileWorker
extends java.lang.Object
Constructor and Description |
---|
FileWorker() |
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<Event> |
read(java.lang.String inputFileFullPath)
Reads a valid configuration file and returns the list of events.
|
java.lang.String |
readMedia(java.lang.String pathToFileToRead)
Reads media files.
|
void |
write(java.util.HashMap<java.lang.Integer,Event> eventMap,
java.io.File outputFile)
Writes a custom configuration in a text file (valid configuration file).
|
public void write(java.util.HashMap<java.lang.Integer,Event> eventMap, java.io.File outputFile) throws java.io.FileNotFoundException
eventMap
- map with the custom events to be saved in the file.outputFile
- absolute path to the text file where data will be savedjava.io.FileNotFoundException
- if outputFile cannot be found.public java.util.ArrayList<Event> read(java.lang.String inputFileFullPath)
inputFileFullPath
- absolute path to the configuration file.public java.lang.String readMedia(java.lang.String pathToFileToRead) throws java.io.FileNotFoundException, java.io.IOException
pathToFileToRead
- absolute path to the media file.java.io.FileNotFoundException
- if file to read cannot be found.java.io.IOException
- if file to read cannot be accessed.