tmf: Fix remote test failing on Windows
authorMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Wed, 18 Nov 2015 21:28:19 +0000 (16:28 -0500)
committerMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Sat, 21 Nov 2015 02:16:55 +0000 (21:16 -0500)
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>
tmf/org.eclipse.tracecompass.tmf.remote.ui/src/org/eclipse/tracecompass/internal/tmf/remote/ui/wizards/fetch/model/RemoteGenerateManifestOperation.java

index 83923d4109e917f9238b5f3671610b46de046261..72e0ae7873f611f5446d10206c40b5daf8208bca 100644 (file)
@@ -181,6 +181,7 @@ public class RemoteGenerateManifestOperation extends AbstractGenerateManifestOpe
                         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;
@@ -189,8 +190,7 @@ public class RemoteGenerateManifestOperation extends AbstractGenerateManifestOpe
                         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();
This page took 0.027424 seconds and 5 git commands to generate.