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.physical_file_system; | 5 library analyzer.file_system.physical_file_system; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:core' hide Resource; | 8 import 'dart:core' hide Resource; |
9 import 'dart:io' as io; | 9 import 'dart:io' as io; |
10 | 10 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 String readAsStringSync() { | 125 String readAsStringSync() { |
126 try { | 126 try { |
127 io.File file = _entry as io.File; | 127 io.File file = _entry as io.File; |
128 return FileBasedSource.fileReadMode(file.readAsStringSync()); | 128 return FileBasedSource.fileReadMode(file.readAsStringSync()); |
129 } on io.FileSystemException catch (exception) { | 129 } on io.FileSystemException catch (exception) { |
130 throw new FileSystemException(exception.path, exception.message); | 130 throw new FileSystemException(exception.path, exception.message); |
131 } | 131 } |
132 } | 132 } |
133 | 133 |
134 @override | 134 @override |
135 Resource renameSync(String newPath) { | 135 File renameSync(String newPath) { |
136 try { | 136 try { |
137 io.File file = _entry as io.File; | 137 io.File file = _entry as io.File; |
138 io.File newFile = file.renameSync(newPath); | 138 io.File newFile = file.renameSync(newPath); |
139 return new _PhysicalFile(newFile); | 139 return new _PhysicalFile(newFile); |
140 } on io.FileSystemException catch (exception) { | 140 } on io.FileSystemException catch (exception) { |
141 throw new FileSystemException(exception.path, exception.message); | 141 throw new FileSystemException(exception.path, exception.message); |
142 } | 142 } |
143 } | 143 } |
144 | 144 |
145 @override | 145 @override |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 bool operator ==(other) { | 251 bool operator ==(other) { |
252 if (runtimeType != other.runtimeType) { | 252 if (runtimeType != other.runtimeType) { |
253 return false; | 253 return false; |
254 } | 254 } |
255 return path == other.path; | 255 return path == other.path; |
256 } | 256 } |
257 | 257 |
258 @override | 258 @override |
259 String toString() => path; | 259 String toString() => path; |
260 } | 260 } |
OLD | NEW |