IFileInfo.getSize() returns 0 for directories on Windows. "For
directories, the return value is unspecified" so the right thing to do
is to add an isDirectory check.
Change-Id: I6112287adc6cef8fcd7c609edab5bbdfbd933ba3
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/60756
Reviewed-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
fullArchivePath = fullArchivePath.removeLastSegments(1);
fDirectoryTraces.add(fullArchivePath);
fileStore = fileStore.getParent();
+ sourceInfo = fileStore.fetchInfo();
parent = parentElement.getParent();
// Let the auto-detection choose the best trace type
traceType = null;
continue;
}
- IFileInfo info = fileStore.fetchInfo();
- if (info.getLength() > 0) {
+ if (sourceInfo.getLength() > 0 || sourceInfo.isDirectory()) {
// Only add non-empty files
String traceName = fullArchivePath.lastSegment();
String fileName = fileStore.getName();