| 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 25 matching lines...) Expand all Loading... |
| 36 * If the path [path] is a relative path, convert it to an absolute path | 36 * If the path [path] is a relative path, convert it to an absolute path |
| 37 * by interpreting it relative to this folder. If it is already an aboslute | 37 * by interpreting it relative to this folder. If it is already an aboslute |
| 38 * path, then don't change it. | 38 * path, then don't change it. |
| 39 * | 39 * |
| 40 * However, regardless of whether [path] is relative or absolute, normalize | 40 * However, regardless of whether [path] is relative or absolute, normalize |
| 41 * it by removing path components of the form '.' or '..'. | 41 * it by removing path components of the form '.' or '..'. |
| 42 */ | 42 */ |
| 43 String canonicalizePath(String path); | 43 String canonicalizePath(String path); |
| 44 | 44 |
| 45 /** | 45 /** |
| 46 * Return `true` if absolute [path] references a resource in this folder. |
| 47 */ |
| 48 bool contains(String path); |
| 49 |
| 50 /** |
| 46 * Return an existing child [Resource] with the given [relPath]. | 51 * Return an existing child [Resource] with the given [relPath]. |
| 47 * Return a not existing [File] if no such child exist. | 52 * Return a not existing [File] if no such child exist. |
| 48 */ | 53 */ |
| 49 Resource getChild(String relPath); | 54 Resource getChild(String relPath); |
| 50 | 55 |
| 51 /** | 56 /** |
| 52 * Return a list of existing direct children [Resource]s (folders and files) | 57 * Return a list of existing direct children [Resource]s (folders and files) |
| 53 * in this folder, in no particular order. | 58 * in this folder, in no particular order. |
| 54 */ | 59 */ |
| 55 List<Resource> getChildren(); | 60 List<Resource> getChildren(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 } | 132 } |
| 128 | 133 |
| 129 /** | 134 /** |
| 130 * Return `true` if the given URI is a `file` URI. | 135 * Return `true` if the given URI is a `file` URI. |
| 131 * | 136 * |
| 132 * @param uri the URI being tested | 137 * @param uri the URI being tested |
| 133 * @return `true` if the given URI is a `file` URI | 138 * @return `true` if the given URI is a `file` URI |
| 134 */ | 139 */ |
| 135 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME; | 140 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME; |
| 136 } | 141 } |
| OLD | NEW |