public List<EtcdNode> listDir(String key, boolean recursive) throws EtcdClientException {
        Preconditions.checkNotNull(key);

        Map<String, String> params = new HashMap<String, String>();
        if (recursive) {
            params.put("recursive", String.valueOf(true));
        }

        URI uri = buildUriWithKeyAndParams(key, params);
        HttpGet httpGet = new HttpGet(uri);

        EtcdResult result = syncExecute(httpGet, new int[] {200, 404}, 100);
        if (null == result || null == result.node) {
            return null;
        }

        return result.node.nodes;
    }
public List < EtcdNode > listDir ( String key , boolean recursive ) throws EtcdClientException { Preconditions . checkNotNull ( key ) ; Map < String , String > params = new HashMap < String , String > ( ) ; if ( recursive ) { params . put ( "recursive" , String . valueOf ( true ) ) ; } URI uri = buildUriWithKeyAndParams ( key , params ) ; HttpGet httpGet = new HttpGet ( uri ) ; EtcdResult result = syncExecute ( httpGet , new int [ ] { 200 , 404 } , 100 ) ; if ( null == result || null == result . node ) { return null ; } return result . node . nodes ; }
Listing a directory with recursive
@param key the dir key
@param recursive recursive
@return CEtcdNode list
@throws EtcdClientException