| OLD | NEW |
| 1 library java.io; | 1 library java.io; |
| 2 | 2 |
| 3 import "dart:io"; | 3 import "dart:io"; |
| 4 | 4 |
| 5 import 'package:path/path.dart' as pathos; | 5 import 'package:path/path.dart' as pathos; |
| 6 | 6 |
| 7 import 'java_core.dart' show JavaIOException; | 7 import 'java_core.dart' show JavaIOException; |
| 8 | 8 |
| 9 class JavaFile { | 9 class JavaFile { |
| 10 static final String separator = Platform.pathSeparator; | 10 static final String separator = Platform.pathSeparator; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 bool isDirectory() { | 64 bool isDirectory() { |
| 65 return _newDirectory().existsSync(); | 65 return _newDirectory().existsSync(); |
| 66 } | 66 } |
| 67 bool isExecutable() { | 67 bool isExecutable() { |
| 68 return _newFile().statSync().mode & 0x111 != 0; | 68 return _newFile().statSync().mode & 0x111 != 0; |
| 69 } | 69 } |
| 70 bool isFile() { | 70 bool isFile() { |
| 71 return _newFile().existsSync(); | 71 return _newFile().existsSync(); |
| 72 } | 72 } |
| 73 int lastModified() { | 73 int lastModified() { |
| 74 if (!_newFile().existsSync()) return 0; | 74 try { |
| 75 return _newFile().lastModifiedSync().millisecondsSinceEpoch; | 75 return _newFile().lastModifiedSync().millisecondsSinceEpoch; |
| 76 | 76 } catch (exception) { |
| 77 return -1; |
| 78 } |
| 77 } | 79 } |
| 78 List<JavaFile> listFiles() { | 80 List<JavaFile> listFiles() { |
| 79 var files = <JavaFile>[]; | 81 var files = <JavaFile>[]; |
| 80 var entities = _newDirectory().listSync(); | 82 var entities = _newDirectory().listSync(); |
| 81 for (FileSystemEntity entity in entities) { | 83 for (FileSystemEntity entity in entities) { |
| 82 files.add(new JavaFile(entity.path)); | 84 files.add(new JavaFile(entity.path)); |
| 83 } | 85 } |
| 84 return files; | 86 return files; |
| 85 } | 87 } |
| 86 String readAsStringSync() => _newFile().readAsStringSync(); | 88 String readAsStringSync() => _newFile().readAsStringSync(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 } | 134 } |
| 133 } | 135 } |
| 134 return null; | 136 return null; |
| 135 } | 137 } |
| 136 static String setProperty(String name, String value) { | 138 static String setProperty(String name, String value) { |
| 137 String oldValue = _properties[name]; | 139 String oldValue = _properties[name]; |
| 138 _properties[name] = value; | 140 _properties[name] = value; |
| 139 return oldValue; | 141 return oldValue; |
| 140 } | 142 } |
| 141 } | 143 } |
| OLD | NEW |