Hi Doug,

I'll create a patch.  Is everyone ok with us implementing Map even though we are
technically breaking the contract defined in
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Map.html  "An object that maps keys 
to
values. A map cannot contain duplicate keys; each key can map to at most one value."

I'm ok with it but wanted to make sure others were prior to creating something.

Matt



                                                                                       
                                                                           
                    Doug Cutting <[EMAIL PROTECTED]>                                   
                                                                           
                    Sent by:                                 To:     [EMAIL PROTECTED] 
                                                                               
                    [EMAIL PROTECTED]       cc:                                        
                                                          
                    eforge.net                               Subject:     Re: 
[Nutch-dev] Http Protocol                                                           
                                                                                       
                                                                           
                                                                                       
                                                                           
                    07/06/2004 01:19 PM                                                
                                                                           
                    Please respond to dev                                              
                                                                           
                                                                                       
                                                                           




Matt Tencati wrote:
> metadata information is stored via Properties which implements Map only allows a 
> single
> value for a given key.  Authentication allows for multiple WWW-Authenticate headers 
> so
> that the client can create a new request and choose any of the given challenges as 
> the
> method to authenticate.

Yes, this is a bug.

I think the best way to implement a fix is with a Map from String to
String[], then have an accessor method, get(String), which returns the
first value in the array.

This should probably be a class called Metadata in the io package,
implementing Writable.  It could replace Properties in Content and
ParseData.  Something like:

public class Metadata implements Map, Writable {
   public void add(String, String);
   public String get(String);
   public String[] getAll(String);
   ...
}

Does that sound reasonable to you?  Would you like to make a patch?

Doug


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Nutch-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nutch-developers





-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Nutch-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nutch-developers

Reply via email to