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

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

Issue 479593002: Test for JavaFile.toURI(). (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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
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