| 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 physical_file_system; | 5 library physical_file_system; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io' as io; | 8 import 'dart:io' as io; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/java_io.dart'; | 10 import 'package:analyzer/src/generated/java_io.dart'; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 return isWithin(this.path, path); | 123 return isWithin(this.path, path); |
| 124 } | 124 } |
| 125 | 125 |
| 126 @override | 126 @override |
| 127 Resource getChild(String relPath) { | 127 Resource getChild(String relPath) { |
| 128 String canonicalPath = canonicalizePath(relPath); | 128 String canonicalPath = canonicalizePath(relPath); |
| 129 return PhysicalResourceProvider.INSTANCE.getResource(canonicalPath); | 129 return PhysicalResourceProvider.INSTANCE.getResource(canonicalPath); |
| 130 } | 130 } |
| 131 | 131 |
| 132 @override | 132 @override |
| 133 _PhysicalFolder getChildAssumingFolder(String relPath) { |
| 134 String canonicalPath = canonicalizePath(relPath); |
| 135 io.Directory directory = new io.Directory(canonicalPath); |
| 136 return new _PhysicalFolder(directory); |
| 137 } |
| 138 |
| 139 @override |
| 133 List<Resource> getChildren() { | 140 List<Resource> getChildren() { |
| 134 List<Resource> children = <Resource>[]; | 141 List<Resource> children = <Resource>[]; |
| 135 io.Directory directory = _entry as io.Directory; | 142 io.Directory directory = _entry as io.Directory; |
| 136 List<io.FileSystemEntity> entries = directory.listSync(recursive: false); | 143 List<io.FileSystemEntity> entries = directory.listSync(recursive: false); |
| 137 int numEntries = entries.length; | 144 int numEntries = entries.length; |
| 138 for (int i = 0; i < numEntries; i++) { | 145 for (int i = 0; i < numEntries; i++) { |
| 139 io.FileSystemEntity entity = entries[i]; | 146 io.FileSystemEntity entity = entries[i]; |
| 140 if (entity is io.Directory) { | 147 if (entity is io.Directory) { |
| 141 children.add(new _PhysicalFolder(entity)); | 148 children.add(new _PhysicalFolder(entity)); |
| 142 } else if (entity is io.File) { | 149 } else if (entity is io.File) { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 bool operator ==(other) { | 196 bool operator ==(other) { |
| 190 if (runtimeType != other.runtimeType) { | 197 if (runtimeType != other.runtimeType) { |
| 191 return false; | 198 return false; |
| 192 } | 199 } |
| 193 return path == other.path; | 200 return path == other.path; |
| 194 } | 201 } |
| 195 | 202 |
| 196 @override | 203 @override |
| 197 String toString() => path; | 204 String toString() => path; |
| 198 } | 205 } |
| OLD | NEW |