| OLD | NEW |
| 1 library java.io; | 1 library java.io; |
| 2 | 2 |
| 3 import "dart:io"; | 3 import "dart:io"; |
| 4 import 'package:path/path.dart' as pathos; | 4 import 'package:path/path.dart' as pathos; |
| 5 | 5 |
| 6 class JavaSystemIO { | 6 class JavaSystemIO { |
| 7 static Map<String, String> _properties = new Map(); | 7 static Map<String, String> _properties = new Map(); |
| 8 static String getProperty(String name) { | 8 static String getProperty(String name) { |
| 9 { | 9 { |
| 10 String value = _properties[name]; | 10 String value = _properties[name]; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // "." or "/" or "C:\" | 81 // "." or "/" or "C:\" |
| 82 if (result.length < 4) return null; | 82 if (result.length < 4) return null; |
| 83 return result; | 83 return result; |
| 84 } | 84 } |
| 85 JavaFile getParentFile() { | 85 JavaFile getParentFile() { |
| 86 var parent = getParent(); | 86 var parent = getParent(); |
| 87 if (parent == null) return null; | 87 if (parent == null) return null; |
| 88 return new JavaFile(parent); | 88 return new JavaFile(parent); |
| 89 } | 89 } |
| 90 String getAbsolutePath() => pathos.absolute(_path); | 90 String getAbsolutePath() => pathos.absolute(_path); |
| 91 String getCanonicalPath() => _newFile().fullPathSync(); | 91 // TODO(scheglov) it seems that this method is broken on Windows |
| 92 // String getCanonicalPath() => _newFile().fullPathSync(); |
| 93 String getCanonicalPath() => getAbsolutePath(); |
| 92 JavaFile getAbsoluteFile() => new JavaFile(getAbsolutePath()); | 94 JavaFile getAbsoluteFile() => new JavaFile(getAbsolutePath()); |
| 93 JavaFile getCanonicalFile() => new JavaFile(getCanonicalPath()); | 95 JavaFile getCanonicalFile() => new JavaFile(getCanonicalPath()); |
| 94 bool exists() { | 96 bool exists() { |
| 95 if (_newFile().existsSync()) { | 97 if (_newFile().existsSync()) { |
| 96 return true; | 98 return true; |
| 97 } | 99 } |
| 98 if (_newDirectory().existsSync()) { | 100 if (_newDirectory().existsSync()) { |
| 99 return true; | 101 return true; |
| 100 } | 102 } |
| 101 return false; | 103 return false; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 114 List<JavaFile> files = []; | 116 List<JavaFile> files = []; |
| 115 List<FileSystemEntity> entities = _newDirectory().listSync(); | 117 List<FileSystemEntity> entities = _newDirectory().listSync(); |
| 116 for (FileSystemEntity entity in entities) { | 118 for (FileSystemEntity entity in entities) { |
| 117 files.add(new JavaFile(entity.path)); | 119 files.add(new JavaFile(entity.path)); |
| 118 } | 120 } |
| 119 return files; | 121 return files; |
| 120 } | 122 } |
| 121 File _newFile() => new File(_path); | 123 File _newFile() => new File(_path); |
| 122 Directory _newDirectory() => new Directory(_path); | 124 Directory _newDirectory() => new Directory(_path); |
| 123 } | 125 } |
| OLD | NEW |