Zip file uri's / hashtable


I now have beagle indexing zip files (without gnome-vfs), and there's a
little problem which effects a lot of beagle. 

A typical zip file uri is:

but using System.Uri this is equal to:


This means all the uri keyed hashtables in beagle (HitRegulator.cs,
LuceneDriver.cs, QueryImpl.cs, QueryResult.cs) think all the "zip file
uris" are the same.

Currently I am using 

public class UriComparer : IComparer {
  public int Compare(object uri1, object uri2)  {
    return String.Compare(uri1.ToString(), uri2.ToString());

public class UriHasher : IHashCodeProvider {
  public int GetHashCode(object o) {
    return o.ToString().GetHashCode();

and "new Hashtable (new UriHasher(), new UriComparer());" on all
uri-keyed hashtables. Alternatively beagle could use an internal format
to specify a zip file (which doesn't have a # in it).

Is there a preferred approach?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]