| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 class _FileInputStream extends _BaseDataInputStream implements InputStream { | 5 class _FileInputStream extends _BaseDataInputStream implements InputStream { |
| 6 _FileInputStream(String name) { | 6 _FileInputStream(String name) { |
| 7 _file = new File(name); | 7 _file = new File(name); |
| 8 _data = []; | 8 _data = []; |
| 9 _position = 0; | 9 _position = 0; |
| 10 _file.errorHandler = (String s) { | 10 _file.errorHandler = (String s) { |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 request[1] = _name; | 411 request[1] = _name; |
| 412 _fileService.call(request).receive((path, replyTo) { | 412 _fileService.call(request).receive((path, replyTo) { |
| 413 if (path != null) { | 413 if (path != null) { |
| 414 if (_directoryHandler != null) _directoryHandler(new Directory(path)); | 414 if (_directoryHandler != null) _directoryHandler(new Directory(path)); |
| 415 } else if (_errorHandler != null) { | 415 } else if (_errorHandler != null) { |
| 416 _errorHandler("Cannot get directory for: ${_name}"); | 416 _errorHandler("Cannot get directory for: ${_name}"); |
| 417 } | 417 } |
| 418 }); | 418 }); |
| 419 } | 419 } |
| 420 | 420 |
| 421 void directorySync() { | 421 Directory directorySync() { |
| 422 if (_asyncUsed) { | 422 if (_asyncUsed) { |
| 423 throw new FileIOException( | 423 throw new FileIOException( |
| 424 "Mixed use of synchronous and asynchronous API"); | 424 "Mixed use of synchronous and asynchronous API"); |
| 425 } | 425 } |
| 426 if (!existsSync()) { | 426 if (!existsSync()) { |
| 427 throw new FileIOException("Cannot get directory for: $_name"); | 427 throw new FileIOException("Cannot get directory for: $_name"); |
| 428 } | 428 } |
| 429 return new Directory(_FileUtils.directory(_name)); | 429 return new Directory(_FileUtils.directory(_name)); |
| 430 } | 430 } |
| 431 | 431 |
| (...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 Function _readByteHandler; | 1199 Function _readByteHandler; |
| 1200 Function _readListHandler; | 1200 Function _readListHandler; |
| 1201 Function _noPendingWriteHandler; | 1201 Function _noPendingWriteHandler; |
| 1202 Function _positionHandler; | 1202 Function _positionHandler; |
| 1203 Function _setPositionHandler; | 1203 Function _setPositionHandler; |
| 1204 Function _truncateHandler; | 1204 Function _truncateHandler; |
| 1205 Function _lengthHandler; | 1205 Function _lengthHandler; |
| 1206 Function _flushHandler; | 1206 Function _flushHandler; |
| 1207 Function _errorHandler; | 1207 Function _errorHandler; |
| 1208 } | 1208 } |
| OLD | NEW |