| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 library engine.source.io; | 3 library engine.source.io; |
| 4 import 'source.dart'; | 4 import 'source.dart'; |
| 5 import 'java_core.dart'; | 5 import 'java_core.dart'; |
| 6 import 'java_io.dart'; | 6 import 'java_io.dart'; |
| 7 import 'engine.dart' show AnalysisContext, AnalysisEngine; | 7 import 'engine.dart' show AnalysisContext, AnalysisEngine; |
| 8 export 'source.dart'; | 8 export 'source.dart'; |
| 9 /** | 9 /** |
| 10 * Instances of the class `FileBasedSource` implement a source that represents a
file. | 10 * Instances of the class `FileBasedSource` implement a source that represents a
file. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 return file.lastModified(); | 88 return file.lastModified(); |
| 89 } | 89 } |
| 90 String get shortName => file.getName(); | 90 String get shortName => file.getName(); |
| 91 UriKind get uriKind => _uriKind; | 91 UriKind get uriKind => _uriKind; |
| 92 int get hashCode => file.hashCode; | 92 int get hashCode => file.hashCode; |
| 93 bool get isInSystemLibrary => identical(_uriKind, UriKind.DART_URI); | 93 bool get isInSystemLibrary => identical(_uriKind, UriKind.DART_URI); |
| 94 Source resolveRelative(Uri containedUri) { | 94 Source resolveRelative(Uri containedUri) { |
| 95 try { | 95 try { |
| 96 Uri resolvedUri = file.toURI().resolveUri(containedUri); | 96 Uri resolvedUri = file.toURI().resolveUri(containedUri); |
| 97 return new FileBasedSource.con2(_contentCache, new JavaFile.fromUri(resolv
edUri), _uriKind); | 97 return new FileBasedSource.con2(_contentCache, new JavaFile.fromUri(resolv
edUri), _uriKind); |
| 98 } catch (exception) { | 98 } on JavaException catch (exception) { |
| 99 } | 99 } |
| 100 return null; | 100 return null; |
| 101 } | 101 } |
| 102 String toString() { | 102 String toString() { |
| 103 if (file == null) { | 103 if (file == null) { |
| 104 return "<unknown source>"; | 104 return "<unknown source>"; |
| 105 } | 105 } |
| 106 return file.getAbsolutePath(); | 106 return file.getAbsolutePath(); |
| 107 } | 107 } |
| 108 | 108 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 for (JavaFile packagesDirectory in _packagesDirectories) { | 215 for (JavaFile packagesDirectory in _packagesDirectories) { |
| 216 List<JavaFile> pkgFolders = packagesDirectory.listFiles(); | 216 List<JavaFile> pkgFolders = packagesDirectory.listFiles(); |
| 217 if (pkgFolders != null) { | 217 if (pkgFolders != null) { |
| 218 for (JavaFile pkgFolder in pkgFolders) { | 218 for (JavaFile pkgFolder in pkgFolders) { |
| 219 try { | 219 try { |
| 220 String pkgCanonicalPath = pkgFolder.getCanonicalPath(); | 220 String pkgCanonicalPath = pkgFolder.getCanonicalPath(); |
| 221 if (sourcePath.startsWith(pkgCanonicalPath)) { | 221 if (sourcePath.startsWith(pkgCanonicalPath)) { |
| 222 String relPath = sourcePath.substring(pkgCanonicalPath.length); | 222 String relPath = sourcePath.substring(pkgCanonicalPath.length); |
| 223 return parseUriWithException("${PACKAGE_SCHEME}:${pkgFolder.getN
ame()}${relPath}"); | 223 return parseUriWithException("${PACKAGE_SCHEME}:${pkgFolder.getN
ame()}${relPath}"); |
| 224 } | 224 } |
| 225 } catch (e) { | 225 } on JavaException catch (e) { |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 } | 230 } |
| 231 return null; | 231 return null; |
| 232 } | 232 } |
| 233 | 233 |
| 234 /** | 234 /** |
| 235 * Answer the canonical file for the specified package. | 235 * Answer the canonical file for the specified package. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 } | 342 } |
| 343 return null; | 343 return null; |
| 344 } | 344 } |
| 345 Source resolveAbsolute(ContentCache contentCache, Uri uri) { | 345 Source resolveAbsolute(ContentCache contentCache, Uri uri) { |
| 346 if (!isFileUri(uri)) { | 346 if (!isFileUri(uri)) { |
| 347 return null; | 347 return null; |
| 348 } | 348 } |
| 349 return new FileBasedSource.con1(contentCache, new JavaFile.fromUri(uri)); | 349 return new FileBasedSource.con1(contentCache, new JavaFile.fromUri(uri)); |
| 350 } | 350 } |
| 351 } | 351 } |
| OLD | NEW |