4 // Copyright (C) 2005 Debajyoti Bera <dbera.web@gmail.com>
8 // Permission is hereby granted, free of charge, to any person obtaining a
9 // copy of this software and associated documentation files (the "Software"),
10 // to deal in the Software without restriction, including without limitation
11 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 // and/or sell copies of the Software, and to permit persons to whom the
13 // Software is furnished to do so, subject to the following conditions:
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 // DEALINGS IN THE SOFTWARE.
30 namespace Beagle
.Util
{
31 public class KonqHistoryUtil
{
32 public const string KonqCacheMimeType
= "beagle/x-konq-cache";
34 public static bool ShouldIndex (StreamReader reader
,
36 out string creation_date
,
40 // format from kdelibs/kioslave/http/http.cc
41 // line-1: Cache revision - mine is 7
42 // FIXME: What happens when cache revision changes ???
46 string _url
= reader
.ReadLine ();
47 url
= System
.Web
.HttpUtility
.UrlDecode (_url
);
49 // line-3: creation date
50 creation_date
= reader
.ReadLine ();
52 // line-4: expiry date
60 // line-6: last-modified
64 // line-7: mimetype for the data
66 // we only index text/plain and text/html - anything else ?
67 mimetype
= reader
.ReadLine ();
69 // line-8: charset for the rest data
71 charset
= reader
.ReadLine ();
74 Console.WriteLine ("FilterKonqHistory:" +
76 " date=" + creation_date +
77 " mimetype=" + mimetype +
78 " charset=" + charset);
81 return (mimetype
== "text/html");