\r
if (!name1.equals(name2)) {\r
String str = String.format(Locale.ROOT, "%s\nworkbook1 -> %s [%d] != workbook2 -> %s [%d]",\r
- "Name of the sheets do not match ::",\r
- loc1.sheet.getSheetName(), name1, i+1,\r
- loc2.sheet.getSheetName(), name2, i+1\r
+ "Name of the sheets do not match ::", name1, i+1, name2, i+1\r
);\r
listOfDifferences.add(str);\r
}\r
// (.xls) and the other a SpreadsheetML file (.xlsx), then the names
// for both CSV files will be identical and one CSV file will,
// therefore, over-write the other.
- for(File excelFile : filesList) {
- // Open the workbook
- this.openWorkbook(excelFile);
-
- // Convert it's contents into a CSV file
- this.convertToCSV();
-
- // Build the name of the csv folder from that of the Excel workbook.
- // Simply replace the .xls or .xlsx file extension with .csv
- destinationFilename = excelFile.getName();
- destinationFilename = destinationFilename.substring(
- 0, destinationFilename.lastIndexOf(".")) +
- ToCSV.CSV_FILE_EXTENSION;
-
- // Save the CSV file away using the newly constricted file name
- // and to the specified directory.
- this.saveCSVFile(new File(destination, destinationFilename));
+ if (filesList != null) {
+ for(File excelFile : filesList) {
+ // Open the workbook
+ this.openWorkbook(excelFile);
+
+ // Convert it's contents into a CSV file
+ this.convertToCSV();
+
+ // Build the name of the csv folder from that of the Excel workbook.
+ // Simply replace the .xls or .xlsx file extension with .csv
+ destinationFilename = excelFile.getName();
+ destinationFilename = destinationFilename.substring(
+ 0, destinationFilename.lastIndexOf(".")) +
+ ToCSV.CSV_FILE_EXTENSION;
+
+ // Save the CSV file away using the newly constricted file name
+ // and to the specified directory.
+ this.saveCSVFile(new File(destination, destinationFilename));
+ }
}
}
private static void collectTests(File root, File arg, List<Class<?>> out, String ptrn, String exclude)
throws ClassNotFoundException {
if (arg.isDirectory()) {
- for (File f : arg.listFiles()) {
- collectTests(root, f, out, ptrn, exclude);
+ File files[] = arg.listFiles();
+ if (files != null) {
+ for (File f : files) {
+ collectTests(root, f, out, ptrn, exclude);
+ }
}
} else {
String path = arg.getAbsolutePath();