Package collectionManagers
Interface FileManager
- All Known Implementing Classes:
- CSVManager
public interface FileManager
The 
Managers interface represents a collection manager that reads and writes objects from and to a file.
 It has two methods to read objects from a file and write objects to a file.- 
Method SummaryModifier and TypeMethodDescriptionreadFromFile(String pathToDataFile) Reads a file at the specified path and returns an ArrayList containing each line of the file as a string.voidWrites a TreeSet of City objects to a file located at the specified path.
- 
Method Details- 
readFromFileReads a file at the specified path and returns an ArrayList containing each line of the file as a string.- Parameters:
- pathToDataFile- The path to the file to read.
- Returns:
- An ArrayList containing each line of the file as a string.
- Throws:
- IOException- If there is an error reading the file.
 
- 
writeWrites a TreeSet of City objects to a file located at the specified path.- Parameters:
- pathToDataFile- the path to the file to be written
- header- An array of strings representing the header row of the CSV file.
- records- An array of objects representing the records to write to the CSV file. Each record should be an array of objects corresponding to a row in the CSV file.
- Throws:
- IOException- if there was an error writing to the file
 
 
-