| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 JavaFile getCanonicalFile() => new JavaFile(getCanonicalPath()); | 96 JavaFile getCanonicalFile() => new JavaFile(getCanonicalPath()); |
| 97 bool exists() { | 97 bool exists() { |
| 98 if (_newFile().existsSync()) { | 98 if (_newFile().existsSync()) { |
| 99 return true; | 99 return true; |
| 100 } | 100 } |
| 101 if (_newDirectory().existsSync()) { | 101 if (_newDirectory().existsSync()) { |
| 102 return true; | 102 return true; |
| 103 } | 103 } |
| 104 return false; | 104 return false; |
| 105 } | 105 } |
| 106 bool isExecutable() { |
| 107 return _newFile().statSync().mode & 0x111 != 0; |
| 108 } |
| 106 bool isFile() { | 109 bool isFile() { |
| 107 return _newFile().existsSync(); | 110 return _newFile().existsSync(); |
| 108 } | 111 } |
| 109 bool isDirectory() { | 112 bool isDirectory() { |
| 110 return _newDirectory().existsSync(); | 113 return _newDirectory().existsSync(); |
| 111 } | 114 } |
| 112 Uri toURI() => pathos.toUri(_path); | 115 Uri toURI() => pathos.toUri(_path); |
| 113 String readAsStringSync() => _newFile().readAsStringSync(); | 116 String readAsStringSync() => _newFile().readAsStringSync(); |
| 114 int lastModified() { | 117 int lastModified() { |
| 115 if (!_newFile().existsSync()) return 0; | 118 if (!_newFile().existsSync()) return 0; |
| 116 return _newFile().lastModifiedSync().millisecondsSinceEpoch; | 119 return _newFile().lastModifiedSync().millisecondsSinceEpoch; |
| 117 | 120 |
| 118 } | 121 } |
| 119 List<JavaFile> listFiles() { | 122 List<JavaFile> listFiles() { |
| 120 var files = <JavaFile>[]; | 123 var files = <JavaFile>[]; |
| 121 var entities = _newDirectory().listSync(); | 124 var entities = _newDirectory().listSync(); |
| 122 for (FileSystemEntity entity in entities) { | 125 for (FileSystemEntity entity in entities) { |
| 123 files.add(new JavaFile(entity.path)); | 126 files.add(new JavaFile(entity.path)); |
| 124 } | 127 } |
| 125 return files; | 128 return files; |
| 126 } | 129 } |
| 127 File _newFile() => new File(_path); | 130 File _newFile() => new File(_path); |
| 128 Directory _newDirectory() => new Directory(_path); | 131 Directory _newDirectory() => new Directory(_path); |
| 129 } | 132 } |
| OLD | NEW |