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

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

Issue 156503002: Fix for JavaFile path in DDA. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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/bin/analyzer.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; 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/bin/analyzer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698