question: public void printLayout ( String path , int indent , StringBuilder string ) throws KeeperException , InterruptedException { byte [ ] data = getData ( path , null , null , true ) ; List < String > children = getChildren ( path , null , true ) ; StringBuilder dent = new StringBuilder ( ) ; for ( int i = 0 ; i < indent ; i ++ ) { dent . append ( " " ) ; } string . append ( dent + path + " (" + children . size ( ) + ")" + NEWL ) ; if ( data != null ) { String dataString = new String ( data , StandardCharsets . UTF_8 ) ; if ( ( ! path . endsWith ( ".txt" ) && ! path . endsWith ( ".xml" ) ) || path . endsWith ( ZkStateReader . CLUSTER_STATE ) ) { if ( path . endsWith ( ".xml" ) ) { dataString = prettyPrint ( dataString ) ; } string . append ( dent + "DATA:\n" + dent + "    " + dataString . replaceAll ( "\n" , "\n" + dent + "    " ) + NEWL ) ; } else { string . append ( dent + "DATA: ...supressed..." + NEWL ) ; } } for ( String child : children ) { if ( ! child . equals ( "quota" ) ) { try { printLayout ( path + ( path . equals ( "/" ) ? "" : "/" ) + child , indent + 1 , string ) ; } catch ( NoNodeException e ) { } } } }
target:  Fills string with printout of current ZooKeeper layout.