/** * Verify a path exists. * * @param path path of operation * @throws PathNotFoundException if the path is absent * @throws IOException */ public String zkPathMustExist(String path) throws IOException { zkStat(path); return path; }
/** * Verify a path exists * @param path path of operation * @throws PathNotFoundException if the path is absent * @throws IOException */ public String zkPathMustExist(String path) throws IOException { zkStat(path); return path; }
/** * Probe for a path existing * @param path path of operation * @return true if the path was visible from the ZK server * queried. * @throws IOException on any exception other than * {@link PathNotFoundException} */ public boolean zkPathExists(String path) throws IOException { checkServiceLive(); try { // if zkStat(path) returns without throwing an exception, the return value // is guaranteed to be not null zkStat(path); return true; } catch (PathNotFoundException e) { return false; } catch (IOException e) { throw e; } }
/** * Probe for a path existing. * * @param path path of operation * @return true if the path was visible from the ZK server * queried. * @throws IOException on any exception other than * {@link PathNotFoundException} */ public boolean zkPathExists(String path) throws IOException { checkServiceLive(); try { // if zkStat(path) returns without throwing an exception, the return value // is guaranteed to be not null zkStat(path); return true; } catch (PathNotFoundException e) { return false; } catch (IOException e) { throw e; } }