OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 part of dart.core; | 5 part of dart.core; |
6 | 6 |
7 /** | 7 /** |
8 * A resource that can be read into the program. | 8 * DEPRECATED. A resource that can be read into the program. |
9 * | 9 * |
10 * WARNING: This API is _experimental_, | 10 * WARNING: This API is _deprecated_, |
11 * and it may be changed or removed in future releases | 11 * and it will be removed in 1.14. Please use |
| 12 * https://pub.dartlang.org/packages/resource instead. |
12 * | 13 * |
13 * A resource is data that can be located using a URI and read into | 14 * A resource is data that can be located using a URI and read into |
14 * the program at runtime. | 15 * the program at runtime. |
15 * The URI may use the `package` scheme to read resources provided | 16 * The URI may use the `package` scheme to read resources provided |
16 * along with package sources. | 17 * along with package sources. |
17 */ | 18 */ |
| 19 @Deprecated('1.14') |
18 abstract class Resource { | 20 abstract class Resource { |
19 /** | 21 /** |
20 * Creates a resource object with the given [uri] as location. | 22 * Creates a resource object with the given [uri] as location. |
21 * | 23 * |
22 * The `uri` is a string containing a valid URI. | 24 * The `uri` is a string containing a valid URI. |
23 * If the string is not a valid URI, using any of the functions on | 25 * If the string is not a valid URI, using any of the functions on |
24 * the resource object will fail. | 26 * the resource object will fail. |
25 * | 27 * |
26 * The URI may be relative, in which case it will be resolved | 28 * The URI may be relative, in which case it will be resolved |
27 * against [Uri.base] before being used. | 29 * against [Uri.base] before being used. |
(...skipping 18 matching lines...) Expand all Loading... |
46 Future<List<int>> readAsBytes(); | 48 Future<List<int>> readAsBytes(); |
47 | 49 |
48 /** | 50 /** |
49 * Read the resource content as a string. | 51 * Read the resource content as a string. |
50 * | 52 * |
51 * The content is decoded into a string using an [Encoding]. | 53 * The content is decoded into a string using an [Encoding]. |
52 * If no other encoding is provided, it defaults to UTF-8. | 54 * If no other encoding is provided, it defaults to UTF-8. |
53 */ | 55 */ |
54 Future<String> readAsString({Encoding encoding}); | 56 Future<String> readAsString({Encoding encoding}); |
55 } | 57 } |
OLD | NEW |