com.bradmcevoy.http
Class SimpleDigestResource

java.lang.Object
  extended by com.bradmcevoy.http.SimpleResource
      extended by com.bradmcevoy.http.SimpleDigestResource
All Implemented Interfaces:
DigestResource, GetableResource, PostableResource, Resource

public class SimpleDigestResource
extends SimpleResource
implements DigestResource

Author:
brad

Constructor Summary
SimpleDigestResource(java.lang.String name, java.util.Date modDate, byte[] content, java.lang.String contentType, java.lang.String uniqueId, DigestResource secureResource)
           
SimpleDigestResource(java.lang.String name, java.util.Date modDate, byte[] content, java.lang.String contentType, java.lang.String uniqueId, java.lang.String realm)
           
 
Method Summary
 java.lang.Object authenticate(DigestResponse digestRequest)
          Check the given credentials, and return a relevant object if accepted.
 boolean isDigestAllowed()
           
 
Methods inherited from class com.bradmcevoy.http.SimpleResource
authenticate, authorise, checkRedirect, getContentLength, getContentType, getMaxAgeSeconds, getModifiedDate, getName, getRealm, getUniqueId, processForm, sendContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bradmcevoy.http.Resource
authenticate, authorise, checkRedirect, getModifiedDate, getName, getRealm, getUniqueId
 

Constructor Detail

SimpleDigestResource

public SimpleDigestResource(java.lang.String name,
                            java.util.Date modDate,
                            byte[] content,
                            java.lang.String contentType,
                            java.lang.String uniqueId,
                            java.lang.String realm)

SimpleDigestResource

public SimpleDigestResource(java.lang.String name,
                            java.util.Date modDate,
                            byte[] content,
                            java.lang.String contentType,
                            java.lang.String uniqueId,
                            DigestResource secureResource)
Method Detail

authenticate

public java.lang.Object authenticate(DigestResponse digestRequest)
Description copied from interface: DigestResource
Check the given credentials, and return a relevant object if accepted. Returning null indicates credentials were not accpeted You SHOULD use com.bradmcevoy.http.http11.auth.DigestGenerator to implement digest calculation, and then compare that to the given request digest.

Specified by:
authenticate in interface DigestResource
Parameters:
digestRequest - - the digest authentication information provided by the client
Returns:
- if credentials are accepted, some object to attach to the Auth object. otherwise null

isDigestAllowed

public boolean isDigestAllowed()
Specified by:
isDigestAllowed in interface DigestResource
Returns:
- true if this resource actually allows digest authentication.


Copyright © 2011. All Rights Reserved.