public byte[] GetData(string path, bool watch, Stat stat) { byte[] returnBytes = null; try { returnBytes = Zk.GetData(path, watch, stat); } catch (Exception e) { log.Error(String.Format("An error occured while trying to get data. Exception: {0}", e.ToString())); } return(returnBytes); }
/// <summary> /// Read value from znode /// </summary> public void Read() { _path = GetPath(_input1); try { var data = Zk.GetData(_path, this, null /*stat*/); AppendLineShow(String.Format("Value of {0} is {1}", _input1, Encoding.UTF8.GetString(data))); } catch (KeeperException.NoNodeException) { AppendLineShow("Znode does not exist!"); } catch (KeeperException) { AppendLineShow(string.Format("Znode {0} isn't valid!", _input1)); } catch (InvalidOperationException) { AppendLineShow(string.Format("Znode {0} isn't valid!", _input1)); } }