| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 int get hashCode => file.hashCode; | 151 int get hashCode => file.hashCode; |
| 152 | 152 |
| 153 @override | 153 @override |
| 154 bool get isInSystemLibrary => uriKind == UriKind.DART_URI; | 154 bool get isInSystemLibrary => uriKind == UriKind.DART_URI; |
| 155 | 155 |
| 156 @override | 156 @override |
| 157 Source resolveRelative(Uri containedUri) { | 157 Source resolveRelative(Uri containedUri) { |
| 158 try { | 158 try { |
| 159 Uri resolvedUri = file.toURI().resolveUri(containedUri); | 159 Uri resolvedUri = file.toURI().resolveUri(containedUri); |
| 160 return new FileBasedSource.con2(new JavaFile.fromUri(resolvedUri), uriKind
); | 160 return new FileBasedSource.con2(new JavaFile.fromUri(resolvedUri), uriKind
); |
| 161 } on JavaException catch (exception) { | 161 } catch (exception) { |
| 162 } | 162 } |
| 163 return null; | 163 return null; |
| 164 } | 164 } |
| 165 | 165 |
| 166 @override | 166 @override |
| 167 String toString() { | 167 String toString() { |
| 168 if (file == null) { | 168 if (file == null) { |
| 169 return "<unknown source>"; | 169 return "<unknown source>"; |
| 170 } | 170 } |
| 171 return file.getAbsolutePath(); | 171 return file.getAbsolutePath(); |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 for (JavaFile packagesDirectory in _packagesDirectories) { | 380 for (JavaFile packagesDirectory in _packagesDirectories) { |
| 381 List<JavaFile> pkgFolders = packagesDirectory.listFiles(); | 381 List<JavaFile> pkgFolders = packagesDirectory.listFiles(); |
| 382 if (pkgFolders != null) { | 382 if (pkgFolders != null) { |
| 383 for (JavaFile pkgFolder in pkgFolders) { | 383 for (JavaFile pkgFolder in pkgFolders) { |
| 384 try { | 384 try { |
| 385 String pkgCanonicalPath = pkgFolder.getCanonicalPath(); | 385 String pkgCanonicalPath = pkgFolder.getCanonicalPath(); |
| 386 if (sourcePath.startsWith(pkgCanonicalPath)) { | 386 if (sourcePath.startsWith(pkgCanonicalPath)) { |
| 387 String relPath = sourcePath.substring(pkgCanonicalPath.length); | 387 String relPath = sourcePath.substring(pkgCanonicalPath.length); |
| 388 return parseUriWithException("${PACKAGE_SCHEME}:${pkgFolder.getN
ame()}${relPath}"); | 388 return parseUriWithException("${PACKAGE_SCHEME}:${pkgFolder.getN
ame()}${relPath}"); |
| 389 } | 389 } |
| 390 } on JavaException catch (e) { | 390 } catch (e) { |
| 391 } | 391 } |
| 392 } | 392 } |
| 393 } | 393 } |
| 394 } | 394 } |
| 395 } | 395 } |
| 396 return null; | 396 return null; |
| 397 } | 397 } |
| 398 | 398 |
| 399 /** | 399 /** |
| 400 * Answer the canonical file for the specified package. | 400 * Answer the canonical file for the specified package. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 for (JavaFile dir in _relativeDirectories) { | 485 for (JavaFile dir in _relativeDirectories) { |
| 486 JavaFile file = new JavaFile.relative(dir, filePath); | 486 JavaFile file = new JavaFile.relative(dir, filePath); |
| 487 if (file.exists()) { | 487 if (file.exists()) { |
| 488 return new FileBasedSource.con2(file, UriKind.FILE_URI); | 488 return new FileBasedSource.con2(file, UriKind.FILE_URI); |
| 489 } | 489 } |
| 490 } | 490 } |
| 491 } | 491 } |
| 492 return null; | 492 return null; |
| 493 } | 493 } |
| 494 } | 494 } |
| OLD | NEW |