| 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 const CREATE_REQUEST = 0; | 7 static const CREATE_REQUEST = 0; |
| 8 static const DELETE_REQUEST = 1; | 8 static const DELETE_REQUEST = 1; |
| 9 static const EXISTS_REQUEST = 2; | 9 static const EXISTS_REQUEST = 2; |
| 10 static const CREATE_TEMP_REQUEST = 3; | 10 static const CREATE_TEMP_REQUEST = 3; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } else { | 59 } else { |
| 60 future = future.chain((index) { | 60 future = future.chain((index) { |
| 61 if (index != -1) { | 61 if (index != -1) { |
| 62 return new Future.immediate(index); | 62 return new Future.immediate(index); |
| 63 } | 63 } |
| 64 return dirsToCreate[i].exists().transform((e) => e ? i : -1); | 64 return dirsToCreate[i].exists().transform((e) => e ? i : -1); |
| 65 }); | 65 }); |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 if (future == null) { | 68 if (future == null) { |
| 69 return new Future.immedidate(-1); | 69 return new Future.immediate(-1); |
| 70 } else { | 70 } else { |
| 71 return future; | 71 return future; |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 | 74 |
| 75 Future<Directory> createRecursively() { | 75 Future<Directory> createRecursively() { |
| 76 if (_path is !String) { | 76 if (_path is !String) { |
| 77 throw new ArgumentError(); | 77 throw new ArgumentError(); |
| 78 } | 78 } |
| 79 var path = new Path.fromNative(_path); | 79 var path = new Path.fromNative(_path); |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 } else { | 337 } else { |
| 338 throw e; | 338 throw e; |
| 339 } | 339 } |
| 340 } | 340 } |
| 341 | 341 |
| 342 Function _onDir; | 342 Function _onDir; |
| 343 Function _onFile; | 343 Function _onFile; |
| 344 Function _onDone; | 344 Function _onDone; |
| 345 Function _onError; | 345 Function _onError; |
| 346 } | 346 } |
| OLD | NEW |