| OLD | NEW |
| 1 library java.io; | 1 library java.io; |
| 2 | 2 |
| 3 import "dart:io"; | 3 import "dart:io"; |
| 4 | 4 |
| 5 class JavaSystemIO { | 5 class JavaSystemIO { |
| 6 static Map<String, String> _properties = new Map(); | 6 static Map<String, String> _properties = new Map(); |
| 7 static String getProperty(String name) { | 7 static String getProperty(String name) { |
| 8 { | 8 { |
| 9 String value = _properties[name]; | 9 String value = _properties[name]; |
| 10 if (value != null) { | 10 if (value != null) { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 if (_newDirectory().existsSync()) { | 98 if (_newDirectory().existsSync()) { |
| 99 return true; | 99 return true; |
| 100 } | 100 } |
| 101 return false; | 101 return false; |
| 102 } | 102 } |
| 103 bool isDirectory() { | 103 bool isDirectory() { |
| 104 return _newDirectory().existsSync(); | 104 return _newDirectory().existsSync(); |
| 105 } | 105 } |
| 106 Uri toURI() => new Uri(path: _path.toString()); | 106 Uri toURI() => new Uri(path: _path.toString()); |
| 107 String readAsStringSync() => _newFile().readAsStringSync(); | 107 String readAsStringSync() => _newFile().readAsStringSync(); |
| 108 int lastModified() => _newFile().lastModifiedSync().millisecondsSinceEpoch; | 108 int lastModified() { |
| 109 if (!_newFile().existsSync()) return 0; |
| 110 return _newFile().lastModifiedSync().millisecondsSinceEpoch; |
| 111 |
| 112 } |
| 109 List<JavaFile> listFiles() { | 113 List<JavaFile> listFiles() { |
| 110 List<JavaFile> files = []; | 114 List<JavaFile> files = []; |
| 111 List<FileSystemEntity> entities = _newDirectory().listSync(); | 115 List<FileSystemEntity> entities = _newDirectory().listSync(); |
| 112 for (FileSystemEntity entity in entities) { | 116 for (FileSystemEntity entity in entities) { |
| 113 files.add(new JavaFile(entity.path)); | 117 files.add(new JavaFile(entity.path)); |
| 114 } | 118 } |
| 115 return files; | 119 return files; |
| 116 } | 120 } |
| 117 File _newFile() => new File.fromPath(_path); | 121 File _newFile() => new File.fromPath(_path); |
| 118 Directory _newDirectory() => new Directory.fromPath(_path); | 122 Directory _newDirectory() => new Directory.fromPath(_path); |
| 119 } | 123 } |
| OLD | NEW |