question: public void mkdir ( String key ) throws IOException { key = key . replace ( " " , "" ) ; if ( key . endsWith ( "/" ) && ! key . equals ( "/" ) ) { throw new InvalidParameterException ( "Trailing slash not allowed in zookeeper path" ) ; } String [ ] split = key . split ( "/" ) ; StringBuilder builder = new StringBuilder ( ) ; for ( String s : split ) { builder . append ( s ) ; if ( ! s . isEmpty ( ) && ! exists ( builder . toString ( ) ) ) { zkState . set ( builder . toString ( ) , null ) ; } builder . append ( "/" ) ; } }
target:  Creates the zNode if it does not exist. Will create parent directories.