| 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 analyzer.file_system.file_system; | 5 library analyzer.file_system.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:analyzer/src/util/absolute_path.dart'; | 10 import 'package:analyzer/src/util/absolute_path.dart'; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 */ | 37 */ |
| 38 List<int> readAsBytesSync(); | 38 List<int> readAsBytesSync(); |
| 39 | 39 |
| 40 /** | 40 /** |
| 41 * Synchronously read the entire file contents as a [String]. | 41 * Synchronously read the entire file contents as a [String]. |
| 42 * Throws [FileSystemException] if the file does not exist. | 42 * Throws [FileSystemException] if the file does not exist. |
| 43 */ | 43 */ |
| 44 String readAsStringSync(); | 44 String readAsStringSync(); |
| 45 | 45 |
| 46 /** | 46 /** |
| 47 * Synchronously rename this file. |
| 48 * Return a [File] instance for the renamed file. |
| 49 * |
| 50 * If [newPath] identifies an existing file, that file is replaced. |
| 51 * If [newPath] identifies an existing resource the operation might fail and |
| 52 * an exception is thrown. |
| 53 */ |
| 54 File renameSync(String newPath); |
| 55 |
| 56 /** |
| 47 * Synchronously write a list of bytes to the file. | 57 * Synchronously write a list of bytes to the file. |
| 48 * | 58 * |
| 49 * Throws a [FileSystemException] if the operation fails. | 59 * Throws a [FileSystemException] if the operation fails. |
| 50 */ | 60 */ |
| 51 void writeAsBytesSync(List<int> bytes); | 61 void writeAsBytesSync(List<int> bytes); |
| 52 } | 62 } |
| 53 | 63 |
| 54 /** | 64 /** |
| 55 * Base class for all file system exceptions. | 65 * Base class for all file system exceptions. |
| 56 */ | 66 */ |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 225 |
| 216 @override | 226 @override |
| 217 Uri restoreAbsolute(Source source) => | 227 Uri restoreAbsolute(Source source) => |
| 218 _provider.pathContext.toUri(source.fullName); | 228 _provider.pathContext.toUri(source.fullName); |
| 219 | 229 |
| 220 /** | 230 /** |
| 221 * Return `true` if the given [uri] is a `file` URI. | 231 * Return `true` if the given [uri] is a `file` URI. |
| 222 */ | 232 */ |
| 223 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME; | 233 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME; |
| 224 } | 234 } |
| OLD | NEW |