/** * Get the children. This is the combined list of real children within this directory, as well as virtual children * created by submounts. * * @return the children */ public List<VirtualFile> getChildren() { // isDirectory does the read security check if (!isDirectory()) { return Collections.emptyList(); } final VFS.Mount mount = VFS.getMount(this); final Set<String> submounts = VFS.getSubmounts(this); final List<String> names = mount.getFileSystem().getDirectoryEntries(mount.getMountPoint(), this); final List<VirtualFile> virtualFiles = new ArrayList<VirtualFile>(names.size() + submounts.size()); for (String name : names) { final VirtualFile child = new VirtualFile(name, this); virtualFiles.add(child); submounts.remove(name); } for (String name : submounts) { final VirtualFile child = new VirtualFile(name, this); virtualFiles.add(child); } return virtualFiles; }