@Test public void testCheckExists() { CuratorZookeeperClient curatorClient = new CuratorZookeeperClient(URL.valueOf("zookeeper: String path = "/dubbo/com.alibaba.dubbo.demo.DemoService/providers"; curatorClient.create(path, false); Assert.assertThat(curatorClient.checkExists(path), is(true)); Assert.assertThat(curatorClient.checkExists(path + "/noneexits"), is(false)); }
@Override public boolean checkExists(String path) { try { if (client.checkExists().forPath(path) != null) { return true; } } catch (Exception e) { } return false; }
CuratorZookeeperClient extends AbstractZookeeperClient<CuratorWatcher> { @Override public boolean checkExists(String path) { try { if (client.checkExists().forPath(path) != null) { return true; } } catch (Exception e) { } return false; } }
CuratorZookeeperClient extends AbstractZookeeperClient<CuratorWatcher> { @Override public boolean checkExists(String path) { try { if (client.checkExists().forPath(path) != null) { return true; } } catch (Exception e) { } return false; } CuratorZookeeperClient(URL url); }
CuratorZookeeperClient extends AbstractZookeeperClient<CuratorWatcher> { @Override public boolean checkExists(String path) { try { if (client.checkExists().forPath(path) != null) { return true; } } catch (Exception e) { } return false; } CuratorZookeeperClient(URL url); @Override void createPersistent(String path); @Override void createEphemeral(String path); @Override void delete(String path); @Override List<String> getChildren(String path); @Override boolean checkExists(String path); @Override boolean isConnected(); @Override void doClose(); @Override CuratorWatcher createTargetChildListener(String path, ChildListener listener); @Override List<String> addTargetChildListener(String path, CuratorWatcher listener); @Override void removeTargetChildListener(String path, CuratorWatcher listener); }
CuratorZookeeperClient extends AbstractZookeeperClient<CuratorWatcher> { @Override public boolean checkExists(String path) { try { if (client.checkExists().forPath(path) != null) { return true; } } catch (Exception e) { } return false; } CuratorZookeeperClient(URL url); @Override void createPersistent(String path); @Override void createEphemeral(String path); @Override void delete(String path); @Override List<String> getChildren(String path); @Override boolean checkExists(String path); @Override boolean isConnected(); @Override void doClose(); @Override CuratorWatcher createTargetChildListener(String path, ChildListener listener); @Override List<String> addTargetChildListener(String path, CuratorWatcher listener); @Override void removeTargetChildListener(String path, CuratorWatcher listener);  }