| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.source.io; | 8 library engine.source.io; |
| 9 | 9 |
| 10 import 'source.dart'; | 10 import 'source.dart'; |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 * relative to | 363 * relative to |
| 364 */ | 364 */ |
| 365 PackageUriResolver(this._packagesDirectories) { | 365 PackageUriResolver(this._packagesDirectories) { |
| 366 if (_packagesDirectories.length < 1) { | 366 if (_packagesDirectories.length < 1) { |
| 367 throw new IllegalArgumentException("At least one package directory must be
provided"); | 367 throw new IllegalArgumentException("At least one package directory must be
provided"); |
| 368 } | 368 } |
| 369 } | 369 } |
| 370 | 370 |
| 371 @override | 371 @override |
| 372 Source fromEncoding(UriKind kind, Uri uri) { | 372 Source fromEncoding(UriKind kind, Uri uri) { |
| 373 if (kind == UriKind.PACKAGE_SELF_URI || kind == UriKind.PACKAGE_URI) { | 373 if (kind == UriKind.PACKAGE_URI) { |
| 374 return new FileBasedSource.con2(new JavaFile.fromUri(uri), kind); | 374 return new FileBasedSource.con2(new JavaFile.fromUri(uri), kind); |
| 375 } | 375 } |
| 376 return null; | 376 return null; |
| 377 } | 377 } |
| 378 | 378 |
| 379 @override | 379 @override |
| 380 Source resolveAbsolute(Uri uri) { | 380 Source resolveAbsolute(Uri uri) { |
| 381 if (!isPackageUri(uri)) { | 381 if (!isPackageUri(uri)) { |
| 382 return null; | 382 return null; |
| 383 } | 383 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 400 return null; | 400 return null; |
| 401 } else { | 401 } else { |
| 402 // <pkgName>/<relPath> | 402 // <pkgName>/<relPath> |
| 403 pkgName = path.substring(0, index); | 403 pkgName = path.substring(0, index); |
| 404 relPath = path.substring(index + 1); | 404 relPath = path.substring(index + 1); |
| 405 } | 405 } |
| 406 for (JavaFile packagesDirectory in _packagesDirectories) { | 406 for (JavaFile packagesDirectory in _packagesDirectories) { |
| 407 JavaFile resolvedFile = new JavaFile.relative(packagesDirectory, path); | 407 JavaFile resolvedFile = new JavaFile.relative(packagesDirectory, path); |
| 408 if (resolvedFile.exists()) { | 408 if (resolvedFile.exists()) { |
| 409 JavaFile canonicalFile = getCanonicalFile(packagesDirectory, pkgName, re
lPath); | 409 JavaFile canonicalFile = getCanonicalFile(packagesDirectory, pkgName, re
lPath); |
| 410 UriKind uriKind = _isSelfReference(packagesDirectory, canonicalFile) ? U
riKind.PACKAGE_SELF_URI : UriKind.PACKAGE_URI; | 410 UriKind uriKind = _isSelfReference(packagesDirectory, canonicalFile) ? U
riKind.FILE_URI : UriKind.PACKAGE_URI; |
| 411 return new FileBasedSource.con2(canonicalFile, uriKind); | 411 return new FileBasedSource.con2(canonicalFile, uriKind); |
| 412 } | 412 } |
| 413 } | 413 } |
| 414 return new FileBasedSource.con2(getCanonicalFile(_packagesDirectories[0], pk
gName, relPath), UriKind.PACKAGE_URI); | 414 return new FileBasedSource.con2(getCanonicalFile(_packagesDirectories[0], pk
gName, relPath), UriKind.PACKAGE_URI); |
| 415 } | 415 } |
| 416 | 416 |
| 417 @override | 417 @override |
| 418 Uri restoreAbsolute(Source source) { | 418 Uri restoreAbsolute(Source source) { |
| 419 if (source is FileBasedSource) { | 419 if (source is FileBasedSource) { |
| 420 String sourcePath = source.file.getPath(); | 420 String sourcePath = source.file.getPath(); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 for (JavaFile dir in _relativeDirectories) { | 526 for (JavaFile dir in _relativeDirectories) { |
| 527 JavaFile file = new JavaFile.relative(dir, filePath); | 527 JavaFile file = new JavaFile.relative(dir, filePath); |
| 528 if (file.exists()) { | 528 if (file.exists()) { |
| 529 return new FileBasedSource.con2(file, UriKind.FILE_URI); | 529 return new FileBasedSource.con2(file, UriKind.FILE_URI); |
| 530 } | 530 } |
| 531 } | 531 } |
| 532 } | 532 } |
| 533 return null; | 533 return null; |
| 534 } | 534 } |
| 535 } | 535 } |
| OLD | NEW |