/**
* Writes an array to a file in the working direcotry.
*
* @param fileName filename without path
* @param array array of any object
* @return true if success
*/
public boolean writeArrayToFile(String fileName, Object[] array) {
try (BufferedWriter outputWriter = new BufferedWriter(new FileWriter(fileName))) {
for (Object o : array) {
outputWriter.write(o + "\n");
}
outputWriter.flush();
return true;
} catch (IOException ex) {
return false;
}
}