[blam] Remove unused functions Get{Local,Remote}Channel()
- From: Carlos Martín Nieto <cmartin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [blam] Remove unused functions Get{Local,Remote}Channel()
- Date: Tue, 14 Sep 2010 16:29:30 +0000 (UTC)
commit 2baabdd320ea7eb8ff2a0e5e956d58f0a9cdb880
Author: Carlos MartÃn Nieto <carlos cmartin tk>
Date: Tue Sep 14 17:22:06 2010 +0100
Remove unused functions Get{Local,Remote}Channel()
src/FeedUpdater.cs | 99 ----------------------------------------------------
1 files changed, 0 insertions(+), 99 deletions(-)
---
diff --git a/src/FeedUpdater.cs b/src/FeedUpdater.cs
index 7da817c..efc9c7c 100644
--- a/src/FeedUpdater.cs
+++ b/src/FeedUpdater.cs
@@ -106,105 +106,6 @@ namespace Imendio.Blam {
}
}
- private static WebResponse GetRemoteChannelData (Channel channel)
- {
- HttpWebRequest req = null;
- WebResponse res = null;
-
- try {
- req = (HttpWebRequest) WebRequest.Create(channel.Url);
-
- if(channel.http_username != ""){
- req.Credentials = new NetworkCredential(channel.http_username,
- channel.http_password);
- } else {
- set_credentials_from_uri(req);
- }
-
- if (channel.LastModified != "") {
- req.IfModifiedSince = DateTime.Parse(channel.LastModified);
- }
-
- if (channel.ETag != "") {
- req.Headers.Add("If-None-Match", channel.ETag);
- }
-
- req.Timeout = 20000;
-
- ServicePointManager.CertificatePolicy = new CertCheck();
-
- WebProxy proxy = Proxy.GetProxy();
- if (proxy != null) {
- req.Proxy = proxy;
- }
-
- try {
- res = req.GetResponse();
- } catch (WebException wE) {
- switch (wE.Status) {
- case WebExceptionStatus.ProtocolError:
- if (((HttpWebResponse)wE.Response).StatusCode ==
- HttpStatusCode.NotModified) {
- //Console.Error.WriteLine("No changes to feed.");
- }
- if(((HttpWebResponse)wE.Response).StatusCode ==
- HttpStatusCode.Unauthorized) {
- Console.Error.WriteLine("Unauthorised: " + wE.ToString());
- }
- break;
- case WebExceptionStatus.Timeout:
- //Console.Error.WriteLine("Timed out");
- //Console.Error.WriteLine("Exception: " + wE.ToString());
- break;
- case WebExceptionStatus.TrustFailure:
- Console.Error.WriteLine("TrustFailure: " + wE.ToString());
- break;
- default:
- Console.Error.WriteLine("Exception: " + wE.ToString());
- break;
- }
- }
- } catch (Exception e) {
- Console.Error.WriteLine("Big WebRequest error: {0}", e.Message);
- }
-
- return res;
- }
-
- private static string GetLocalChannel(Channel channel)
- {
- string fs_path = null;
- TextReader reader = null;
- int offset = -1;
-
- /*
- * First, we determine the format the feed was given in. We accept
- * several variants: "file:/u/feed.xml", "file:///u/feed.xml"
- * and "/u/feed.xml". We therefore need to find out how much to
- * strip from the beginning of the string to give us a path that
- * will be accepted by the file system.
- */
-
- if(channel.Url.StartsWith("/")){
- offset = 0;
- } else if(channel.Url.StartsWith("file:///")){
- offset = 7;
- } else if(channel.Url.StartsWith("file:/")){
- offset = 5;
- }
-
- fs_path = channel.Url.Substring(offset, channel.Url.Length - offset);
- try {
- reader = File.OpenText(fs_path);
- } catch(FileNotFoundException e){
- Console.Error.WriteLine("File {0} for URI {1} could not be found: {2}",
- fs_path, channel.Url, e.Message);
- return string.Empty;
- }
-
- return reader.ReadToEnd();
- }
-
public static string GenerateItemId(SyndicationItem item)
{
if(item.Id != null){
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]