Package io.milton.http.fs
Class FsDirectoryResource
java.lang.Object
io.milton.http.fs.FsResource
io.milton.http.fs.FsDirectoryResource
- All Implemented Interfaces:
CollectionResource,CopyableResource,DeletableResource,DigestResource,GetableResource,LockableResource,LockingCollectionResource,MakeCollectionableResource,MoveableResource,PropFindableResource,PutableResource,Resource
public class FsDirectoryResource
extends FsResource
implements MakeCollectionableResource, PutableResource, CopyableResource, DeletableResource, MoveableResource, PropFindableResource, LockingCollectionResource, GetableResource
Represents a directory in a physical file system.
-
Constructor Summary
ConstructorsConstructorDescriptionFsDirectoryResource(String host, FileSystemResourceFactory factory, File dir, FileContentService contentService) -
Method Summary
Modifier and TypeMethodDescriptioncheckRedirect(Request request) Will redirect if a default page has been specified on the factorycreateAndLock(String name, LockTimeout timeout, LockInfo lockInfo) createCollection(String name) createNew(String name, InputStream in, Long length, String contentType) protected voidgetContentType(String accepts) getMaxAgeSeconds(Auth auth) static StringinsertSsoPrefix(String abUrl, String prefix) voidsendContent(OutputStream out, Range range, Map<String, String> params, String contentType) Will generate a listing of the contents of this directory, unless the factory's allowDirectoryBrowsing has been set to false.Methods inherited from class io.milton.http.fs.FsResource
authenticate, authenticate, authorise, compareTo, copyTo, delete, getCreateDate, getCurrentLock, getFile, getModifiedDate, getName, getRealm, getUniqueId, isDigestAllowed, lock, moveTo, refreshLock, unlockMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.milton.resource.CopyableResource
copyToMethods inherited from interface io.milton.resource.DeletableResource
deleteMethods inherited from interface io.milton.resource.LockableResource
getCurrentLock, lock, refreshLock, unlockMethods inherited from interface io.milton.resource.MoveableResource
moveToMethods inherited from interface io.milton.resource.PropFindableResource
getCreateDateMethods inherited from interface io.milton.resource.Resource
authenticate, authorise, getModifiedDate, getName, getRealm, getUniqueId
-
Constructor Details
-
FsDirectoryResource
public FsDirectoryResource(String host, FileSystemResourceFactory factory, File dir, FileContentService contentService)
-
-
Method Details
-
createCollection
- Specified by:
createCollectionin interfaceMakeCollectionableResource
-
child
- Specified by:
childin interfaceCollectionResource
-
getChildren
- Specified by:
getChildrenin interfaceCollectionResource
-
checkRedirect
Will redirect if a default page has been specified on the factory- Specified by:
checkRedirectin interfaceResource- Parameters:
request-- Returns:
-
createNew
public Resource createNew(String name, InputStream in, Long length, String contentType) throws IOException - Specified by:
createNewin interfacePutableResource- Throws:
IOException
-
doCopy
- Specified by:
doCopyin classFsResource- Throws:
NotAuthorizedException
-
createAndLock
public LockToken createAndLock(String name, LockTimeout timeout, LockInfo lockInfo) throws NotAuthorizedException - Specified by:
createAndLockin interfaceLockingCollectionResource- Throws:
NotAuthorizedException
-
sendContent
public void sendContent(OutputStream out, Range range, Map<String, String> params, String contentType) throws IOException, NotAuthorizedExceptionWill generate a listing of the contents of this directory, unless the factory's allowDirectoryBrowsing has been set to false. If so it will just output a message saying that access has been disabled.- Specified by:
sendContentin interfaceGetableResource- Parameters:
out-range-params-contentType-- Throws:
IOExceptionNotAuthorizedException
-
getMaxAgeSeconds
- Specified by:
getMaxAgeSecondsin interfaceGetableResource
-
getContentType
- Specified by:
getContentTypein interfaceGetableResource
-
getContentLength
- Specified by:
getContentLengthin interfaceGetableResource
-
insertSsoPrefix
-