| OLD | NEW |
| 1 library java.io; | 1 library java.io; |
| 2 | 2 |
| 3 import "dart:io"; | 3 import "dart:io"; |
| 4 import 'java_core.dart' show JavaIOException, CharSequence; | 4 import 'java_core.dart' show JavaIOException, CharSequence; |
| 5 import 'package:path/path.dart' as pathos; | 5 import 'package:path/path.dart' as pathos; |
| 6 | 6 |
| 7 class JavaSystemIO { | 7 class JavaSystemIO { |
| 8 static Map<String, String> _properties = new Map(); | 8 static Map<String, String> _properties = new Map(); |
| 9 static String getProperty(String name) { | 9 static String getProperty(String name) { |
| 10 { | 10 { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 } | 105 } |
| 106 bool isExecutable() { | 106 bool isExecutable() { |
| 107 return _newFile().statSync().mode & 0x111 != 0; | 107 return _newFile().statSync().mode & 0x111 != 0; |
| 108 } | 108 } |
| 109 bool isFile() { | 109 bool isFile() { |
| 110 return _newFile().existsSync(); | 110 return _newFile().existsSync(); |
| 111 } | 111 } |
| 112 bool isDirectory() { | 112 bool isDirectory() { |
| 113 return _newDirectory().existsSync(); | 113 return _newDirectory().existsSync(); |
| 114 } | 114 } |
| 115 Uri toURI() => pathos.toUri(_path); | 115 Uri toURI() { |
| 116 String path = getAbsolutePath(); |
| 117 return pathos.toUri(path); |
| 118 } |
| 116 String readAsStringSync() => _newFile().readAsStringSync(); | 119 String readAsStringSync() => _newFile().readAsStringSync(); |
| 117 int lastModified() { | 120 int lastModified() { |
| 118 if (!_newFile().existsSync()) return 0; | 121 if (!_newFile().existsSync()) return 0; |
| 119 return _newFile().lastModifiedSync().millisecondsSinceEpoch; | 122 return _newFile().lastModifiedSync().millisecondsSinceEpoch; |
| 120 | 123 |
| 121 } | 124 } |
| 122 List<JavaFile> listFiles() { | 125 List<JavaFile> listFiles() { |
| 123 var files = <JavaFile>[]; | 126 var files = <JavaFile>[]; |
| 124 var entities = _newDirectory().listSync(); | 127 var entities = _newDirectory().listSync(); |
| 125 for (FileSystemEntity entity in entities) { | 128 for (FileSystemEntity entity in entities) { |
| 126 files.add(new JavaFile(entity.path)); | 129 files.add(new JavaFile(entity.path)); |
| 127 } | 130 } |
| 128 return files; | 131 return files; |
| 129 } | 132 } |
| 130 File _newFile() => new File(_path); | 133 File _newFile() => new File(_path); |
| 131 Directory _newDirectory() => new Directory(_path); | 134 Directory _newDirectory() => new Directory(_path); |
| 132 } | 135 } |
| OLD | NEW |