com.ettrema.http.fs
Class FsResource

java.lang.Object
  extended by com.ettrema.http.fs.FsResource
All Implemented Interfaces:
CopyableResource, DigestResource, LockableResource, MoveableResource, Resource
Direct Known Subclasses:
FsDirectoryResource, FsFileResource

public abstract class FsResource
extends java.lang.Object
implements Resource, MoveableResource, CopyableResource, LockableResource, DigestResource


Constructor Summary
FsResource(java.lang.String host, FileSystemResourceFactory factory, java.io.File file)
           
 
Method Summary
 java.lang.Object authenticate(DigestResponse digestRequest)
           
 java.lang.Object authenticate(java.lang.String user, java.lang.String password)
           
 boolean authorise(Request request, Request.Method method, Auth auth)
           
 int compareTo(Resource o)
           
 void copyTo(CollectionResource newParent, java.lang.String newName)
           
 void delete()
           
protected abstract  void doCopy(java.io.File dest)
           
 java.util.Date getCreateDate()
           
 LockToken getCurrentLock()
           
 java.io.File getFile()
           
 java.util.Date getModifiedDate()
           
 java.lang.String getName()
           
 java.lang.String getRealm()
           
 java.lang.String getUniqueId()
           
 boolean isDigestAllowed()
           
 LockResult lock(LockTimeout timeout, LockInfo lockInfo)
           
 void moveTo(CollectionResource newParent, java.lang.String newName)
           
 LockResult refreshLock(java.lang.String token)
           
 void unlock(java.lang.String tokenId)
           
 
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
checkRedirect
 

Constructor Detail

FsResource

public FsResource(java.lang.String host,
                  FileSystemResourceFactory factory,
                  java.io.File file)
Method Detail

doCopy

protected abstract void doCopy(java.io.File dest)

getFile

public java.io.File getFile()

getUniqueId

public java.lang.String getUniqueId()
Specified by:
getUniqueId in interface Resource

getName

public java.lang.String getName()
Specified by:
getName in interface Resource

authenticate

public java.lang.Object authenticate(java.lang.String user,
                                     java.lang.String password)
Specified by:
authenticate in interface Resource

authenticate

public java.lang.Object authenticate(DigestResponse digestRequest)
Specified by:
authenticate in interface DigestResource

isDigestAllowed

public boolean isDigestAllowed()
Specified by:
isDigestAllowed in interface DigestResource

authorise

public boolean authorise(Request request,
                         Request.Method method,
                         Auth auth)
Specified by:
authorise in interface Resource

getRealm

public java.lang.String getRealm()
Specified by:
getRealm in interface Resource

getModifiedDate

public java.util.Date getModifiedDate()
Specified by:
getModifiedDate in interface Resource

getCreateDate

public java.util.Date getCreateDate()

compareTo

public int compareTo(Resource o)

moveTo

public void moveTo(CollectionResource newParent,
                   java.lang.String newName)
Specified by:
moveTo in interface MoveableResource

copyTo

public void copyTo(CollectionResource newParent,
                   java.lang.String newName)
Specified by:
copyTo in interface CopyableResource

delete

public void delete()

lock

public LockResult lock(LockTimeout timeout,
                       LockInfo lockInfo)
                throws NotAuthorizedException
Specified by:
lock in interface LockableResource
Throws:
NotAuthorizedException

refreshLock

public LockResult refreshLock(java.lang.String token)
                       throws NotAuthorizedException
Specified by:
refreshLock in interface LockableResource
Throws:
NotAuthorizedException

unlock

public void unlock(java.lang.String tokenId)
            throws NotAuthorizedException
Specified by:
unlock in interface LockableResource
Throws:
NotAuthorizedException

getCurrentLock

public LockToken getCurrentLock()
Specified by:
getCurrentLock in interface LockableResource


Copyright © 2011. All Rights Reserved.