3522 fix location of real path conversion to before any file access

This commit is contained in:
William Schaefer 2018-02-02 12:47:32 -05:00
parent ef74c1f30a
commit 703cb9f223

View File

@ -209,7 +209,10 @@ class CaseBrowser extends javax.swing.JPanel implements ExplorerManager.Provider
List<String> nodeList = CoordinationService.getInstance().getNodeList(CoordinationService.CategoryNode.CASES);
for (String node : nodeList) {
Path casePath = Paths.get(node);
Path casePath;
try {
casePath = Paths.get(node).toRealPath(LinkOption.NOFOLLOW_LINKS);
File caseFolder = casePath.toFile();
if (caseFolder.exists()) {
/*
@ -224,14 +227,17 @@ class CaseBrowser extends javax.swing.JPanel implements ExplorerManager.Provider
String name = file.getName().toLowerCase();
if (autFilePath == null && name.endsWith(".aut")) {
try {
caseList.add(new CaseMetadata(Paths.get(file.getAbsolutePath()).toRealPath(LinkOption.NOFOLLOW_LINKS)));
} catch (CaseMetadata.CaseMetadataException | IOException ex) {
caseList.add(new CaseMetadata(Paths.get(file.getAbsolutePath())));
} catch (CaseMetadata.CaseMetadataException ex) {
LOGGER.log(Level.SEVERE, String.format("Error reading case metadata file '%s'.", autFilePath), ex);
}
break;
}
}
}
} catch (IOException ignore) {
//if a path could not be resolved to a real path do add it to the caseList
}
}
return caseList;
}