Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart

Issue 471053002: Issue 20520. JavaFile.toURI() should use absolute path. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/java_io.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/java_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698