| Index: editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart
|
| diff --git a/editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart b/editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart
|
| index d6e79e8f64e989c7c5fa7860ea60491fff46fcd1..d186c47764e3ea535c04ebed30802f42a307b41b 100644
|
| --- a/editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart
|
| +++ b/editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart
|
| @@ -1,7 +1,6 @@
|
| library java.io;
|
|
|
| import "dart:io";
|
| -import 'package:path/path.dart' as pathos;
|
|
|
| class JavaSystemIO {
|
| static Map<String, String> _properties = new Map();
|
| @@ -34,14 +33,14 @@ class JavaSystemIO {
|
| String sdkPath;
|
| // may be "xcodebuild/ReleaseIA32/dart" with "dart-sdk" sibling
|
| {
|
| - sdkPath = pathos.join(pathos.dirname(exec), "dart-sdk");
|
| + sdkPath = new Path(exec).directoryPath.append("dart-sdk").toNativePath();
|
| if (new Directory(sdkPath).existsSync()) {
|
| _properties[name] = sdkPath;
|
| return sdkPath;
|
| }
|
| }
|
| // probably be "dart-sdk/bin/dart"
|
| - sdkPath = pathos.dirname(pathos.dirname(exec));
|
| + sdkPath = new Path(exec).directoryPath.directoryPath.toString();
|
| _properties[name] = sdkPath;
|
| return sdkPath;
|
| }
|
| @@ -59,25 +58,26 @@ class JavaSystemIO {
|
| class JavaFile {
|
| static final String separator = Platform.pathSeparator;
|
| static final int separatorChar = Platform.pathSeparator.codeUnitAt(0);
|
| - String _path;
|
| - JavaFile(this._path);
|
| + Path _path;
|
| + JavaFile(String path) {
|
| + this._path = new Path(path);
|
| + }
|
| JavaFile.relative(JavaFile base, String child) {
|
| if (child.isEmpty) {
|
| this._path = base._path;
|
| } else {
|
| - this._path = pathos.join(base._path, child);
|
| + this._path = base._path.join(new Path(child));
|
| }
|
| }
|
| JavaFile.fromUri(Uri uri) : this(uri.path);
|
| - String toString() => _path.toString();
|
| int get hashCode => _path.hashCode;
|
| bool operator ==(other) {
|
| - return other is JavaFile && other._path == _path;
|
| + return other is JavaFile && other._path.toNativePath() == _path.toNativePath();
|
| }
|
| - String getPath() => _path;
|
| - String getName() => pathos.basename(_path);
|
| + String getPath() => _path.toNativePath();
|
| + String getName() => _path.filename;
|
| String getParent() {
|
| - var result = pathos.dirname(_path);
|
| + var result = _path.directoryPath.toNativePath();
|
| // "." or "/" or "C:\"
|
| if (result.length < 4) return null;
|
| return result;
|
| @@ -87,10 +87,8 @@ class JavaFile {
|
| if (parent == null) return null;
|
| return new JavaFile(parent);
|
| }
|
| - String getAbsolutePath() => pathos.absolute(_path);
|
| - // TODO(scheglov) it seems that this method is broken on Windows
|
| -// String getCanonicalPath() => _newFile().fullPathSync();
|
| - String getCanonicalPath() => getAbsolutePath();
|
| + String getAbsolutePath() => _path.canonicalize().toNativePath();
|
| + String getCanonicalPath() => _path.canonicalize().toNativePath();
|
| JavaFile getAbsoluteFile() => new JavaFile(getAbsolutePath());
|
| JavaFile getCanonicalFile() => new JavaFile(getCanonicalPath());
|
| bool exists() {
|
| @@ -120,6 +118,6 @@ class JavaFile {
|
| }
|
| return files;
|
| }
|
| - File _newFile() => new File(_path);
|
| - Directory _newDirectory() => new Directory(_path);
|
| + File _newFile() => new File.fromPath(_path);
|
| + Directory _newDirectory() => new Directory.fromPath(_path);
|
| }
|
|
|