OLD | NEW |
1 library java.io; | 1 library java.io; |
2 | 2 |
3 import "dart:io"; | 3 import "dart:io"; |
4 | 4 |
5 class JavaSystemIO { | 5 class JavaSystemIO { |
6 static Map<String, String> _properties = new Map(); | 6 static Map<String, String> _properties = new Map(); |
7 static String getProperty(String name) { | 7 static String getProperty(String name) { |
8 { | 8 { |
9 String value = _properties[name]; | 9 String value = _properties[name]; |
10 if (value != null) { | 10 if (value != null) { |
11 return value; | 11 return value; |
12 } | 12 } |
13 } | 13 } |
14 if (name == 'os.name') { | 14 if (name == 'os.name') { |
15 return Platform.operatingSystem; | 15 return Platform.operatingSystem; |
16 } | 16 } |
17 if (name == 'line.separator') { | 17 if (name == 'line.separator') { |
18 if (Platform.operatingSystem == 'windows') { | 18 if (Platform.isWindows) { |
19 return '\r\n'; | 19 return '\r\n'; |
20 } | 20 } |
21 return '\n'; | 21 return '\n'; |
22 } | 22 } |
23 if (name == 'com.google.dart.sdk') { | 23 if (name == 'com.google.dart.sdk') { |
24 String value = Platform.environment['DART_SDK']; | 24 String value = Platform.environment['DART_SDK']; |
25 if (value != null) { | 25 if (value != null) { |
26 _properties[name] = value; | 26 _properties[name] = value; |
27 return value; | 27 return value; |
28 } | 28 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 List<JavaFile> files = []; | 110 List<JavaFile> files = []; |
111 List<FileSystemEntity> entities = _newDirectory().listSync(); | 111 List<FileSystemEntity> entities = _newDirectory().listSync(); |
112 for (FileSystemEntity entity in entities) { | 112 for (FileSystemEntity entity in entities) { |
113 files.add(new JavaFile(entity.path)); | 113 files.add(new JavaFile(entity.path)); |
114 } | 114 } |
115 return files; | 115 return files; |
116 } | 116 } |
117 File _newFile() => new File.fromPath(_path); | 117 File _newFile() => new File.fromPath(_path); |
118 Directory _newDirectory() => new Directory.fromPath(_path); | 118 Directory _newDirectory() => new Directory.fromPath(_path); |
119 } | 119 } |
OLD | NEW |