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; | 4 import 'java_core.dart' show JavaIOException; |
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 return oldValue; | 49 return oldValue; |
50 } | 50 } |
51 static String getenv(String name) => Platform.environment[name]; | 51 static String getenv(String name) => Platform.environment[name]; |
52 } | 52 } |
53 | 53 |
54 class JavaFile { | 54 class JavaFile { |
55 static final String separator = Platform.pathSeparator; | 55 static final String separator = Platform.pathSeparator; |
56 static final int separatorChar = Platform.pathSeparator.codeUnitAt(0); | 56 static final int separatorChar = Platform.pathSeparator.codeUnitAt(0); |
57 String _path; | 57 String _path; |
58 JavaFile(String path) { | 58 JavaFile(String path) { |
59 _path = pathos.normalize(path); | 59 _path = pathos.absolute(path); |
60 } | 60 } |
61 JavaFile.relative(JavaFile base, String child) { | 61 JavaFile.relative(JavaFile base, String child) { |
62 if (child.isEmpty) { | 62 if (child.isEmpty) { |
63 this._path = base._path; | 63 this._path = base._path; |
64 } else { | 64 } else { |
65 this._path = pathos.join(base._path, child); | 65 this._path = pathos.join(base._path, child); |
66 } | 66 } |
67 } | 67 } |
68 JavaFile.fromUri(Uri uri) : this(pathos.fromUri(uri)); | 68 JavaFile.fromUri(Uri uri) : this(pathos.fromUri(uri)); |
69 String toString() => _path.toString(); | 69 String toString() => _path.toString(); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 var files = <JavaFile>[]; | 117 var files = <JavaFile>[]; |
118 var entities = _newDirectory().listSync(); | 118 var entities = _newDirectory().listSync(); |
119 for (FileSystemEntity entity in entities) { | 119 for (FileSystemEntity entity in entities) { |
120 files.add(new JavaFile(entity.path)); | 120 files.add(new JavaFile(entity.path)); |
121 } | 121 } |
122 return files; | 122 return files; |
123 } | 123 } |
124 File _newFile() => new File(_path); | 124 File _newFile() => new File(_path); |
125 Directory _newDirectory() => new Directory(_path); | 125 Directory _newDirectory() => new Directory(_path); |
126 } | 126 } |
OLD | NEW |