public void prune ( ) { if ( children != null ) { List < String > removeList = new ArrayList < String > ( ) ; for ( Entry < String , DepTreeNode > entry : children . entrySet ( ) ) { DepTreeNode child = entry . getValue ( ) ; child . prune ( ) ; if ( ( child . defineDependencies == null && child . requireDependencies == null && child . uri == null ) && ( child . children == null || child . children . isEmpty ( ) ) ) { removeList . add ( entry . getKey ( ) ) ; } } for ( String key : removeList ) { children . remove ( key ) ; } } }
Recursively walks the node tree removing folder nodes that have not children .