Annotation of java/classes/org/w3c/jigsaw/acl/HTTPPermission.java, revision 1.2

1.1       bmahe       1: // HTTPPermission.java
1.2     ! bmahe       2: // $Id: HTTPPermission.java,v 1.1 1999/04/21 16:07:06 bmahe Exp $
1.1       bmahe       3: // (c) COPYRIGHT MIT, INRIA and Keio, 1999.
                      4: // Please first read the full copyright statement in file COPYRIGHT.html
                      5:  
                      6: package org.w3c.jigsaw.acl;
                      7: 
                      8: import java.security.acl.Permission;
                      9: 
                     10: import org.w3c.jigsaw.http.Request;
                     11: 
                     12: /**
1.2     ! bmahe      13:  * @version $Revision: 1.1 $
1.1       bmahe      14:  * @author  Benoît Mahé (bmahe@w3.org)
                     15:  */
                     16: public class HTTPPermission implements Permission {
                     17:     
                     18:     protected String method = null;
                     19: 
                     20:     protected String getMethod() {
                     21:        return method;
                     22:     }
                     23: 
                     24:     public HTTPPermission(Request request) {
                     25:        this.method = request.getMethod();
                     26:     }
                     27: 
                     28:     public boolean equals(Object another) {
                     29:        if (another instanceof HTTPPermission) {
                     30:            return method.equals(((HTTPPermission)another).getMethod());
1.2     ! bmahe      31:        } else {
        !            32:            return method.equals(another.toString());
1.1       bmahe      33:        }
                     34:     }
                     35: 
                     36:     public String toString() {
                     37:        return method+" permission";
                     38:     }
                     39: 
                     40: }

Webmaster