| 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 file_system; | 5 library file_system; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/generated/source.dart'; | 9 import 'package:analyzer/src/generated/source.dart'; |
| 10 import 'package:path/path.dart'; | 10 import 'package:path/path.dart'; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 * Instances of the class [ResourceProvider] convert [String] paths into | 132 * Instances of the class [ResourceProvider] convert [String] paths into |
| 133 * [Resource]s. | 133 * [Resource]s. |
| 134 */ | 134 */ |
| 135 abstract class ResourceProvider { | 135 abstract class ResourceProvider { |
| 136 /** | 136 /** |
| 137 * Get the path context used by this resource provider. | 137 * Get the path context used by this resource provider. |
| 138 */ | 138 */ |
| 139 Context get pathContext; | 139 Context get pathContext; |
| 140 | 140 |
| 141 /** | 141 /** |
| 142 * Return a [File] that corresponds to the given [path]. |
| 143 * |
| 144 * A file may or may not exist at this location. |
| 145 */ |
| 146 File getFile(String path); |
| 147 |
| 148 /** |
| 149 * Return a [Folder] that corresponds to the given [path]. |
| 150 * |
| 151 * A folder may or may not exist at this location. |
| 152 */ |
| 153 Folder getFolder(String path); |
| 154 |
| 155 /** |
| 142 * Return the [Resource] that corresponds to the given [path]. | 156 * Return the [Resource] that corresponds to the given [path]. |
| 143 */ | 157 */ |
| 144 Resource getResource(String path); | 158 Resource getResource(String path); |
| 145 | 159 |
| 146 /** | 160 /** |
| 147 * Return the folder in which the plugin with the given [pluginId] can store | 161 * Return the folder in which the plugin with the given [pluginId] can store |
| 148 * state that will persist across sessions. The folder returned for a given id | 162 * state that will persist across sessions. The folder returned for a given id |
| 149 * will not be returned for a different id, ensuring that plugins do not need | 163 * will not be returned for a different id, ensuring that plugins do not need |
| 150 * to be concerned with file name collisions with other plugins, assuming that | 164 * to be concerned with file name collisions with other plugins, assuming that |
| 151 * the plugin ids are unique. The plugin ids must be valid folder names. | 165 * the plugin ids are unique. The plugin ids must be valid folder names. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 180 } | 194 } |
| 181 | 195 |
| 182 @override | 196 @override |
| 183 Uri restoreAbsolute(Source source) => source.uri; | 197 Uri restoreAbsolute(Source source) => source.uri; |
| 184 | 198 |
| 185 /** | 199 /** |
| 186 * Return `true` if the given [uri] is a `file` URI. | 200 * Return `true` if the given [uri] is a `file` URI. |
| 187 */ | 201 */ |
| 188 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME; | 202 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME; |
| 189 } | 203 } |
| OLD | NEW |