protected override XmlDocument FetchCheckForUpdatesXml() { try { XmlDocument doc = new XmlDocument(); XmlReaderSettings settings = new XmlReaderSettings { IgnoreComments = true, IgnoreWhitespace = true, IgnoreProcessingInstructions = true }; WebRequest wr = WebRequest.Create(_url); using (Stream xmlStream = wr.GetResponse().GetResponseStream()) { if (xmlStream != null) { using (var reader = XmlReader.Create(xmlStream, settings)) doc.Load(reader); } } return(doc); } catch (Exception) { ErrorRaised = new CFUValidationException("Failed to wget the URL: " + _url); throw ErrorRaised; } }
private Stream GetXmlDoc() { try { WebRequest wr = WebRequest.Create(newLocation); return wr.GetResponse().GetResponseStream(); } catch (Exception) { ErrorRaised = new CFUValidationException("Failed to wget the URL: " + newLocation); throw ErrorRaised; } }
private Stream GetXmlDoc() { try { WebRequest wr = WebRequest.Create(newLocation); return(wr.GetResponse().GetResponseStream()); } catch (Exception) { ErrorRaised = new CFUValidationException("Failed to wget the URL: " + newLocation); throw ErrorRaised; } }
protected override XmlDocument FetchCheckForUpdatesXml() { if (!File.Exists(_location)) { ErrorRaised = new CFUValidationException("File not found at: " + _location); throw ErrorRaised; } try { XmlDocument xdoc = new XmlDocument(); using (StreamReader sr = new StreamReader(_location)) xdoc.Load(sr); return(xdoc); } catch (Exception) { ErrorRaised = new CFUValidationException("Could not read/parse file: " + _location); throw ErrorRaised; } }
protected override XmlDocument FetchCheckForUpdatesXml(string location) { if (!File.Exists(newLocation)) { ErrorRaised = new CFUValidationException("File not found at: " + newLocation); throw ErrorRaised; } try { XmlDocument xdoc = new XmlDocument(); using (StreamReader sr = new StreamReader(newLocation)) { xdoc.Load(sr); } return xdoc; } catch(Exception) { ErrorRaised = new CFUValidationException("Could not read/parse file: " + newLocation); throw ErrorRaised; } }