/** * Create a node if not exists * @param path path * @return return true if create */ public Boolean createIfNotExists(String path) { return createIfNotExists(path, (byte[])null); }
/** * Create a node if not exists * @param path path * @param data path data * @return return true if create * @throws Exception */ public Boolean createIfNotExists(String path, String data) { try { return createIfNotExists(path, data.getBytes("UTF-8")); } catch (Exception e) { handleConnectionLoss(e); throw new ZkException(e); } }