| 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 library engine.source.io; | 5 library engine.source.io; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'engine.dart'; | 9 import 'engine.dart'; |
| 10 import 'java_core.dart'; | 10 import 'java_core.dart'; |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 276 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
| 277 if (!isFileUri(uri)) { | 277 if (!isFileUri(uri)) { |
| 278 return null; | 278 return null; |
| 279 } | 279 } |
| 280 return new FileBasedSource( | 280 return new FileBasedSource( |
| 281 new JavaFile.fromUri(uri), actualUri != null ? actualUri : uri); | 281 new JavaFile.fromUri(uri), actualUri != null ? actualUri : uri); |
| 282 } | 282 } |
| 283 | 283 |
| 284 @override | 284 @override |
| 285 Uri restoreAbsolute(Source source) { | 285 Uri restoreAbsolute(Source source) { |
| 286 if (source is FileBasedSource) { | 286 return new Uri.file(source.fullName); |
| 287 return new Uri.file(source.fullName); | |
| 288 } | |
| 289 return null; | |
| 290 } | 287 } |
| 291 | 288 |
| 292 /** | 289 /** |
| 293 * Return `true` if the given URI is a `file` URI. | 290 * Return `true` if the given URI is a `file` URI. |
| 294 * | 291 * |
| 295 * @param uri the URI being tested | 292 * @param uri the URI being tested |
| 296 * @return `true` if the given URI is a `file` URI | 293 * @return `true` if the given URI is a `file` URI |
| 297 */ | 294 */ |
| 298 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME; | 295 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME; |
| 299 } | 296 } |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 } | 550 } |
| 554 | 551 |
| 555 /** | 552 /** |
| 556 * Return `true` if the given URI is a `file` URI. | 553 * Return `true` if the given URI is a `file` URI. |
| 557 * | 554 * |
| 558 * @param uri the URI being tested | 555 * @param uri the URI being tested |
| 559 * @return `true` if the given URI is a `file` URI | 556 * @return `true` if the given URI is a `file` URI |
| 560 */ | 557 */ |
| 561 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME; | 558 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME; |
| 562 } | 559 } |
| OLD | NEW |