OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 import "dart:core" hide Resource; |
| 6 |
| 7 import "loader.dart" show ResourceLoader, DefaultLoader; |
| 8 |
| 9 // TODO(lrn): Merge with implementation when configured imports removes |
| 10 // the need to share code. |
| 11 import "../resource.dart" as base show Resource; |
| 12 |
| 13 class Resource extends base.Resource { |
| 14 /// Creates a resource object with the given [uri] as location. |
| 15 /// |
| 16 /// The [uri] must be either a [Uri] or a string containing a valid URI. |
| 17 /// If the string is not a valid URI, using any of the functions on |
| 18 /// the resource object will fail. |
| 19 /// |
| 20 /// The URI may be relative, in which case it will be resolved |
| 21 /// against [Uri.base] before being used. |
| 22 /// |
| 23 /// The URI may use the `package` scheme, which is always supported. |
| 24 /// Other schemes may also be supported where possible. |
| 25 /// |
| 26 /// If [loader] is provided, it is used to load absolute non-package URIs. |
| 27 /// Package: URIs are resolved to a non-package URI before being loaded, so |
| 28 /// the loader doesn't have to support package: URIs, nor does it need to |
| 29 /// support relative URI references. |
| 30 /// If [loader] is omitted, a default implementation is used which supports |
| 31 /// as many of `http`, `https`, `file` and `data` as are available on the |
| 32 /// current platform. |
| 33 const Resource(uri, {ResourceLoader loader}) |
| 34 : super(uri, (loader != null) ? loader : const DefaultLoader()); |
| 35 } |
OLD | NEW |