*/
private TreeNodeInfoImpl stripChildren(NodeInfoExt newNode) {
if (newNode.getNodeType() == TreeNodeInfo.FILE_TYPE) {
return (TreeNodeInfoImpl) newNode;
}
DirInfoImpl dir = (DirInfoImpl) newNode;
if ((dir.hasFiles() && dir.getFiles().size() > 0) || dir.hasSubDirectories()
&& dir.getSubDirectories().size() > 0) {
// Make a copy; modifying the node would change the real tree.
dir = DirInfoImpl.fromJsonElement(dir.toJsonElement());
dir.clearFiles();
dir.clearSubDirectories();
dir.setIsComplete(false);
}
return dir;
}