Various small enhancements
[lgpl/argeo-commons.git] / org.argeo.eclipse.ui / src / org / argeo / eclipse / ui / fs / NioFileLabelProvider.java
index 391f250eb70fcff5cf6c94ab2b89a6534a18a85e..68fc70b77dae92714aedbd87ef0c14ff51991b55 100644 (file)
@@ -22,7 +22,10 @@ public class NioFileLabelProvider extends ColumnLabelProvider {
                try {
                        switch (propName) {
                        case FsUiConstants.PROPERTY_SIZE:
-                               return FsUiUtils.humanReadableByteCount(Files.size(path), false);
+                               if (Files.isDirectory(path))
+                                       return "-";
+                               else
+                                       return FsUiUtils.humanReadableByteCount(Files.size(path), false);
                        case FsUiConstants.PROPERTY_LAST_MODIFIED:
                                return Files.getLastModifiedTime(path).toString();
                        case FsUiConstants.PROPERTY_TYPE: