File:  [Public] / java / classes / org / w3c / jigsaw / acl / HTTPPermission.java
Revision 1.5: download - view: text, annotated - select for diffs
Fri Oct 18 13:42:12 2013 UTC (10 years, 8 months ago) by ylafon
Branches: MAIN
CVS tags: HEAD
generics + raw types + serializer

// HTTPPermission.java
// $Id: HTTPPermission.java,v 1.5 2013/10/18 13:42:12 ylafon Exp $
// (c) COPYRIGHT MIT, INRIA and Keio, 1999.
// Please first read the full copyright statement in file COPYRIGHT.html

package org.w3c.jigsaw.acl;

import java.security.acl.Permission;

import org.w3c.jigsaw.http.Request;

/**
 * @author Benoît Mahé (bmahe@w3.org)
 * @version $Revision: 1.5 $
 */
public class HTTPPermission implements Permission {

    protected String method = null;

    protected String getMethod() {
        return method;
    }

    public HTTPPermission(Request request) {
        this.method = request.getMethod();
    }

    public boolean equals(Object another) {
        if (another instanceof HTTPPermission) {
            return method.equals(((HTTPPermission) another).getMethod());
        } else {
            return method.equals(another.toString());
        }
    }

    public boolean equalsString(String another) {
        return method.equals(another);
    }

    public String toString() {
        return method + " permission";
    }

}

Webmaster