Index: editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart |
diff --git a/editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart b/editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart |
index d0459a0bef2b4d6a0b6ca09442f33f8a7d24716b..7799d49811be3cb841ae513cf90f2c472cc10ca5 100644 |
--- a/editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart |
+++ b/editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart |
@@ -72,8 +72,17 @@ class JavaFile { |
} |
String getPath() => _path.toNativePath(); |
String getName() => _path.filename; |
- String getParent() => _path.directoryPath.toNativePath(); |
- JavaFile getParentFile() => new JavaFile(getParent()); |
+ String getParent() { |
+ var result = _path.directoryPath.toNativePath(); |
+ // "." or "/" or "C:\" |
+ if (result.length < 4) return null; |
+ return result; |
+ } |
+ JavaFile getParentFile() { |
+ var parent = getParent(); |
+ if (parent == null) return null; |
+ return new JavaFile(parent); |
+ } |
String getAbsolutePath() => _path.canonicalize().toNativePath(); |
String getCanonicalPath() => _path.canonicalize().toNativePath(); |
JavaFile getAbsoluteFile() => new JavaFile(getAbsolutePath()); |