public static boolean checkChrootPath(String zkHost,boolean create) throws KeeperException, InterruptedException {
  if (!containsChroot(zkHost)) {
    return true;
  }
  log.info("zkHost includes chroot");
  String chrootPath=zkHost.substring(zkHost.indexOf("/"),zkHost.length());
  SolrZkClient tmpClient=new SolrZkClient(zkHost.substring(0,zkHost.indexOf("/")),60 * 1000);
  boolean exists=tmpClient.exists(chrootPath,true);
  if (!exists && create) {
    tmpClient.makePath(chrootPath,false,true);
    exists=true;
  }
  tmpClient.close();
  return exists;
}

public static boolean checkChrootPath ( String zkHost , boolean create ) throws KeeperException , InterruptedException { if ( ! containsChroot ( zkHost ) ) { return true ; } log . info ( "zkHost includes chroot" ) ; String chrootPath = zkHost . substring ( zkHost . indexOf ( "/" ) , zkHost . length ( ) ) ; SolrZkClient tmpClient = new SolrZkClient ( zkHost . substring ( 0 , zkHost . indexOf ( "/" ) ) , 60 * 1000 ) ; boolean exists = tmpClient . exists ( chrootPath , true ) ; if ( ! exists && create ) { tmpClient . makePath ( chrootPath , false , true ) ; exists = true ; } tmpClient . close ( ) ; return exists ; }
validates if the chroot exists in zk ( or if it is successfully created ) . optionally , if create is set to true this method will create the path in case it doesn ' t exist
