| 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 part of dart.io; | 5 part of dart.io; |
| 6 | 6 |
| 7 class _Directory extends FileSystemEntity implements Directory { | 7 class _Directory extends FileSystemEntity implements Directory { |
| 8 final String path; | 8 final String path; |
| 9 | 9 |
| 10 _Directory(String this.path) { | 10 _Directory(String this.path) { |
| 11 if (path is! String) { | 11 if (path is! String) { |
| 12 throw new ArgumentError('${Error.safeToString(path)} ' | 12 throw new ArgumentError('${Error.safeToString(path)} ' |
| 13 'is not a String'); | 13 'is not a String'); |
| 14 } | 14 } |
| 15 } | 15 } |
| 16 | 16 |
| 17 factory _Directory.fromUri(Uri uri) => new _Directory(uri.toFilePath()); |
| 18 |
| 17 external static _current(); | 19 external static _current(); |
| 18 external static _setCurrent(path); | 20 external static _setCurrent(path); |
| 19 external static _createTemp(String path); | 21 external static _createTemp(String path); |
| 20 external static String _systemTemp(); | 22 external static String _systemTemp(); |
| 21 external static int _exists(String path); | 23 external static int _exists(String path); |
| 22 external static _create(String path); | 24 external static _create(String path); |
| 23 external static _deleteNative(String path, bool recursive); | 25 external static _deleteNative(String path, bool recursive); |
| 24 external static _rename(String path, String newPath); | 26 external static _rename(String path, String newPath); |
| 25 external static List _list(String path, bool recursive, bool followLinks); | 27 external static List _list(String path, bool recursive, bool followLinks); |
| 26 | 28 |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 controller.addError( | 382 controller.addError( |
| 381 new FileSystemException("Directory listing failed", | 383 new FileSystemException("Directory listing failed", |
| 382 errorPath, | 384 errorPath, |
| 383 err)); | 385 err)); |
| 384 } else { | 386 } else { |
| 385 controller.addError( | 387 controller.addError( |
| 386 new FileSystemException("Internal error")); | 388 new FileSystemException("Internal error")); |
| 387 } | 389 } |
| 388 } | 390 } |
| 389 } | 391 } |
| OLD | NEW |