| 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 | 5 |
| 6 class _Directory implements Directory { | 6 class _Directory implements Directory { |
| 7 static final CREATE_REQUEST = 0; | 7 static final CREATE_REQUEST = 0; |
| 8 static final DELETE_REQUEST = 1; | 8 static final DELETE_REQUEST = 1; |
| 9 static final EXISTS_REQUEST = 2; | 9 static final EXISTS_REQUEST = 2; |
| 10 static final CREATE_TEMP_REQUEST = 3; | 10 static final CREATE_TEMP_REQUEST = 3; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 request[1] = _path; | 81 request[1] = _path; |
| 82 return _directoryService.call(request).transform((response) { | 82 return _directoryService.call(request).transform((response) { |
| 83 if (_isErrorResponse(response)) { | 83 if (_isErrorResponse(response)) { |
| 84 throw _exceptionFromResponse(response, | 84 throw _exceptionFromResponse(response, |
| 85 "Creation of temporary directory failed"); | 85 "Creation of temporary directory failed"); |
| 86 } | 86 } |
| 87 return new Directory(response); | 87 return new Directory(response); |
| 88 }); | 88 }); |
| 89 } | 89 } |
| 90 | 90 |
| 91 Directory createTempSync() { | 91 void createTempSync() { |
| 92 if (_path is !String) { | 92 if (_path is !String) { |
| 93 throw new IllegalArgumentException(); | 93 throw new IllegalArgumentException(); |
| 94 } | 94 } |
| 95 var result = _createTemp(path); | 95 var result = _createTemp(path); |
| 96 if (result is OSError) { | 96 if (result is OSError) { |
| 97 throw new DirectoryIOException("Creation of temporary directory failed", | 97 throw new DirectoryIOException("Creation of temporary directory failed", |
| 98 _path, | 98 _path, |
| 99 result); | 99 result); |
| 100 } | 100 } |
| 101 return new Directory(result); | 101 return new Directory(result); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 } else { | 285 } else { |
| 286 throw e; | 286 throw e; |
| 287 } | 287 } |
| 288 } | 288 } |
| 289 | 289 |
| 290 Function _onDir; | 290 Function _onDir; |
| 291 Function _onFile; | 291 Function _onFile; |
| 292 Function _onDone; | 292 Function _onDone; |
| 293 Function _onError; | 293 Function _onError; |
| 294 } | 294 } |
| OLD | NEW |