Package nl.info.webdav
Class LocalFileSystemStore
java.lang.Object
nl.info.webdav.LocalFileSystemStore
- All Implemented Interfaces:
IWebdavStore
Reference Implementation of WebdavStore
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIndicates that a new request or transaction with this store involved has been started.voidcheckAuthentication(ITransaction transaction) Checks if authentication information passed in is valid.voidcommit(ITransaction transaction) Indicates that all changes done inside this request shall be made permanent and any transactions, connections and other temporary resources shall be terminated.voidcreateFolder(ITransaction transaction, String uri) Creates a folder at the position specified byfolderUri.voidcreateResource(ITransaction transaction, String uri) Creates a content resource at the position specified byresourceUri.voiddestroy()Life cycle method, called by WebdavServlet's destroy() method.String[]getChildrenNames(ITransaction transaction, String uri) Gets the names of the children of the folder specified byfolderUri.getResourceContent(ITransaction transaction, String uri) Gets the content of the resource specified byresourceUri.longgetResourceLength(ITransaction transaction, String uri) Gets the length of the content resource specified byresourceUri.getStoredObject(ITransaction transaction, String uri) Gets the storedObject specified byurivoidremoveObject(ITransaction transaction, String uri) Removes the object specified byuri.voidrollback(ITransaction transaction) Indicates that all changes done inside this request shall be undone and any transactions, connections and other temporary resources shall be terminated.longsetResourceContent(ITransaction transaction, String uri, InputStream is, String contentType, String characterEncoding) Sets / stores the content of the resource specified byresourceUri.
-
Constructor Details
-
LocalFileSystemStore
-
-
Method Details
-
destroy
public void destroy()Description copied from interface:IWebdavStoreLife cycle method, called by WebdavServlet's destroy() method. Should be used to clean up resources.- Specified by:
destroyin interfaceIWebdavStore
-
begin
Description copied from interface:IWebdavStoreIndicates that a new request or transaction with this store involved has been started. The request will be terminated by eitherIWebdavStore.commit(ITransaction)mmi} orIWebdavStore.rollback(ITransaction). If only non-read methods have been called, the request will be terminated by aIWebdavStore.commit(ITransaction). This method will be called by (@link WebdavStoreAdapter} at the beginning of each request.- Specified by:
beginin interfaceIWebdavStore- Parameters:
principal- the principal that started this request ornullif there is none available- Throws:
WebdavException- if something goes wrong on the store level
-
checkAuthentication
Description copied from interface:IWebdavStoreChecks if authentication information passed in is valid. If not throws an exception.- Specified by:
checkAuthenticationin interfaceIWebdavStore- Parameters:
transaction- indicates that the method is within the scope of a WebDAV transaction- Throws:
SecurityException
-
commit
Description copied from interface:IWebdavStoreIndicates that all changes done inside this request shall be made permanent and any transactions, connections and other temporary resources shall be terminated.- Specified by:
commitin interfaceIWebdavStore- Parameters:
transaction- indicates that the method is within the scope of a WebDAV transaction- Throws:
WebdavException- if something goes wrong on the store level
-
rollback
Description copied from interface:IWebdavStoreIndicates that all changes done inside this request shall be undone and any transactions, connections and other temporary resources shall be terminated.- Specified by:
rollbackin interfaceIWebdavStore- Parameters:
transaction- indicates that the method is within the scope of a WebDAV transaction- Throws:
WebdavException- if something goes wrong on the store level
-
createFolder
Description copied from interface:IWebdavStoreCreates a folder at the position specified byfolderUri.- Specified by:
createFolderin interfaceIWebdavStore- Parameters:
transaction- indicates that the method is within the scope of a WebDAV transactionuri- URI of the folder- Throws:
WebdavException- if something goes wrong on the store level
-
createResource
Description copied from interface:IWebdavStoreCreates a content resource at the position specified byresourceUri.- Specified by:
createResourcein interfaceIWebdavStore- Parameters:
transaction- indicates that the method is within the scope of a WebDAV transactionuri- URI of the content resource- Throws:
WebdavException- if something goes wrong on the store level
-
setResourceContent
public long setResourceContent(ITransaction transaction, String uri, InputStream is, String contentType, String characterEncoding) throws WebdavException Description copied from interface:IWebdavStoreSets / stores the content of the resource specified byresourceUri.- Specified by:
setResourceContentin interfaceIWebdavStore- Parameters:
transaction- indicates that the method is within the scope of a WebDAV transactionuri- URI of the resource where the content will be storedis- input stream from which the content will be read fromcontentType- content type of the resource ornullif unknowncharacterEncoding- character encoding of the resource ornullif unknown or not applicable- Returns:
- length of the resource
- Throws:
WebdavException- if something goes wrong on the store level
-
getChildrenNames
Description copied from interface:IWebdavStoreGets the names of the children of the folder specified byfolderUri.- Specified by:
getChildrenNamesin interfaceIWebdavStore- Parameters:
transaction- indicates that the method is within the scope of a WebDAV transactionuri- URI of the folder- Returns:
- a (possibly empty) list of children, or
nullif the uri points to a file - Throws:
WebdavException- if something goes wrong on the store level
-
removeObject
Description copied from interface:IWebdavStoreRemoves the object specified byuri.- Specified by:
removeObjectin interfaceIWebdavStore- Parameters:
transaction- indicates that the method is within the scope of a WebDAV transactionuri- URI of the object, i.e. content resource or folder- Throws:
WebdavException- if something goes wrong on the store level
-
getResourceContent
Description copied from interface:IWebdavStoreGets the content of the resource specified byresourceUri.- Specified by:
getResourceContentin interfaceIWebdavStore- Parameters:
transaction- indicates that the method is within the scope of a WebDAV transactionuri- URI of the content resource- Returns:
- input stream you can read the content of the resource from
- Throws:
WebdavException- if something goes wrong on the store level
-
getResourceLength
Description copied from interface:IWebdavStoreGets the length of the content resource specified byresourceUri.- Specified by:
getResourceLengthin interfaceIWebdavStore- Parameters:
transaction- indicates that the method is within the scope of a WebDAV transactionuri- URI of the content resource- Returns:
- length of the resource in bytes,
-1declares this value as invalid and asks the adapter to try to set it from the properties if possible - Throws:
WebdavException- if something goes wrong on the store level
-
getStoredObject
Description copied from interface:IWebdavStoreGets the storedObject specified byuri- Specified by:
getStoredObjectin interfaceIWebdavStore- Parameters:
transaction- indicates that the method is within the scope of a WebDAV transactionuri- URI- Returns:
- StoredObject
-