Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: pkg/analyzer/lib/file_system/file_system.dart

Issue 1808213004: Add File.renameSync() to virtual file system. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698