///<summary> ///Retrieving Version History ///</summary> public List<FileVer> FileVerHistory(string url) { List<FileVer> lfv = new List<FileVer>(); HttpWebRequest request = WebRequest.Create(url + "/version") as HttpWebRequest; request.Method = "GET"; request.Headers.Add("Authorization", accessToken); using (HttpWebResponse response = request.GetResponse() as HttpWebResponse) { StreamReader reader = new StreamReader(response.GetResponseStream()); XmlDocument doc = new XmlDocument(); doc.LoadXml(reader.ReadToEnd()); foreach (XmlElement xitem in doc.DocumentElement.SelectNodes("//fileVersion")) { XmlDocument wdoc = new XmlDocument(); FileVer f = new FileVer(); wdoc.LoadXml("<root>" + xitem.InnerXml + "</root>"); foreach (XmlElement citem in wdoc.DocumentElement.SelectNodes("//size")) { f.size = citem.InnerText; } foreach (XmlElement citem in wdoc.DocumentElement.SelectNodes("//lastModified")) { f.lastModified = citem.InnerText; } foreach (XmlElement citem in wdoc.DocumentElement.SelectNodes("//mediaType")) { f.mediaType = citem.InnerText; } foreach (XmlElement citem in wdoc.DocumentElement.SelectNodes("//presentOnServer")) { f.presentOnServer = citem.InnerText; } foreach (XmlElement citem in wdoc.DocumentElement.SelectNodes("//fileData")) { f.fileData = citem.InnerText; } foreach (XmlElement citem in wdoc.DocumentElement.SelectNodes("//ref")) { f.reference = citem.InnerText; } lfv.Add(f); } return lfv; } }
///<summary> ///Transcoding Images ///</summary> /// ///<summary> ///Retrieving File Version Information ///Return FileVer ///</summary> public FileVer FileVerInfo(string url, string idversion) { FileVer fv = new FileVer(); HttpWebRequest request = WebRequest.Create(url + "/version/" + idversion) as HttpWebRequest; request.Method = "GET"; request.Headers.Add("Authorization", accessToken); using (HttpWebResponse response = request.GetResponse() as HttpWebResponse) { StreamReader reader = new StreamReader(response.GetResponseStream()); XmlDocument doc = new XmlDocument(); doc.LoadXml(reader.ReadToEnd()); foreach (XmlElement xitem in doc.DocumentElement.SelectNodes("//fileVersion")) { XmlDocument wdoc = new XmlDocument(); wdoc.LoadXml("<root>" + xitem.InnerXml + "</root>"); foreach (XmlElement citem in wdoc.DocumentElement.SelectNodes("//size")) { fv.size = citem.InnerText; } foreach (XmlElement citem in wdoc.DocumentElement.SelectNodes("//lastModified")) { fv.lastModified = citem.InnerText; } foreach (XmlElement citem in wdoc.DocumentElement.SelectNodes("//mediaType")) { fv.mediaType = citem.InnerText; } foreach (XmlElement citem in wdoc.DocumentElement.SelectNodes("//presentOnServer")) { fv.presentOnServer = citem.InnerText; } foreach (XmlElement citem in wdoc.DocumentElement.SelectNodes("//fileData")) { fv.fileData = citem.InnerText; } } } return fv; }
///<summary> ///Retrieving File Version Data ///</summary> public string FileVerData(string url, string idversion) { FileVer fv = new FileVer(); HttpWebRequest request = WebRequest.Create(url + "/version/" + idversion + "/data") as HttpWebRequest; request.Method = "GET"; request.Headers.Add("Authorization", accessToken); using (HttpWebResponse response = request.GetResponse() as HttpWebResponse) { StreamReader reader = new StreamReader(response.GetResponseStream()); return reader.ReadToEnd(); } }