| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 var result = pathos.dirname(_path); | 77 var result = pathos.dirname(_path); |
| 78 // "." or "/" or "C:\" | 78 // "." or "/" or "C:\" |
| 79 if (result.length < 4) return null; | 79 if (result.length < 4) return null; |
| 80 return result; | 80 return result; |
| 81 } | 81 } |
| 82 JavaFile getParentFile() { | 82 JavaFile getParentFile() { |
| 83 var parent = getParent(); | 83 var parent = getParent(); |
| 84 if (parent == null) return null; | 84 if (parent == null) return null; |
| 85 return new JavaFile(parent); | 85 return new JavaFile(parent); |
| 86 } | 86 } |
| 87 String getAbsolutePath() => pathos.absolute(_path); | 87 String getAbsolutePath() { |
| 88 String path = pathos.absolute(_path); |
| 89 path = pathos.normalize(path); |
| 90 return path; |
| 91 } |
| 88 String getCanonicalPath() { | 92 String getCanonicalPath() { |
| 89 try { | 93 try { |
| 90 return _newFile().resolveSymbolicLinksSync(); | 94 return _newFile().resolveSymbolicLinksSync(); |
| 91 } catch (e) { | 95 } catch (e) { |
| 92 throw new JavaIOException('IOException', e); | 96 throw new JavaIOException('IOException', e); |
| 93 } | 97 } |
| 94 } | 98 } |
| 95 JavaFile getAbsoluteFile() => new JavaFile(getAbsolutePath()); | 99 JavaFile getAbsoluteFile() => new JavaFile(getAbsolutePath()); |
| 96 JavaFile getCanonicalFile() => new JavaFile(getCanonicalPath()); | 100 JavaFile getCanonicalFile() => new JavaFile(getCanonicalPath()); |
| 97 bool exists() { | 101 bool exists() { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 126 var files = <JavaFile>[]; | 130 var files = <JavaFile>[]; |
| 127 var entities = _newDirectory().listSync(); | 131 var entities = _newDirectory().listSync(); |
| 128 for (FileSystemEntity entity in entities) { | 132 for (FileSystemEntity entity in entities) { |
| 129 files.add(new JavaFile(entity.path)); | 133 files.add(new JavaFile(entity.path)); |
| 130 } | 134 } |
| 131 return files; | 135 return files; |
| 132 } | 136 } |
| 133 File _newFile() => new File(_path); | 137 File _newFile() => new File(_path); |
| 134 Directory _newDirectory() => new Directory(_path); | 138 Directory _newDirectory() => new Directory(_path); |
| 135 } | 139 } |
| OLD | NEW |