Class FileHelper
Object
FileHelper
This class is used to get the original File object which leads to a directory,
the File object is then converted to an Arraylist carrying File objects that
lead to each file in the directory. This Arraylist is returned.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFileDirectory(String fileDir) Takes a folder path as a parameter and creates a File object out of it, this File object is a directory, so it is converted to an Arraylist holding File objects.getFileScanner(File fileToRead) A File object is used to create a Scanner object to read from.
-
Constructor Details
-
FileHelper
public FileHelper()
-
-
Method Details
-
getFileDirectory
Takes a folder path as a parameter and creates a File object out of it, this File object is a directory, so it is converted to an Arraylist holding File objects.- Parameters:
fileDir- String that contains the path to a directory of Product files.- Returns:
- Arraylist populated with the "ShipmentFolder"s File objects.
-
getFileScanner
A File object is used to create a Scanner object to read from. The 'try' in this case means it will "try" to create a Scanner from the File object. and if the "try" fails, it will be "caught" and we will print our error, FileNotFoundException.- Parameters:
fileToRead- File object that is linked to one file that will be used as a Product.- Returns:
- A Scanner that leads to provided file.
-