public class LocalFileSystemStore extends Object implements IWebdavStore
| Constructor and Description |
|---|
LocalFileSystemStore(File root) |
| Modifier and Type | Method and Description |
|---|---|
ITransaction |
begin(Principal principal)
Indicates that a new request or transaction with this store involved has
been started.
|
void |
checkAuthentication(ITransaction transaction)
Checks if authentication information passed in is valid.
|
void |
commit(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.
|
void |
createFolder(ITransaction transaction,
String uri)
Creates a folder at the position specified by
folderUri. |
void |
createResource(ITransaction transaction,
String uri)
Creates a content resource at the position specified by
resourceUri. |
void |
destroy()
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 by
folderUri. |
InputStream |
getResourceContent(ITransaction transaction,
String uri)
Gets the content of the resource specified by
resourceUri. |
long |
getResourceLength(ITransaction transaction,
String uri)
Gets the length of the content resource specified by
resourceUri. |
StoredObject |
getStoredObject(ITransaction transaction,
String uri)
Gets the storedObject specified by
uri |
void |
removeObject(ITransaction transaction,
String uri)
Removes the object specified by
uri. |
void |
rollback(ITransaction transaction)
Indicates that all changes done inside this request shall be undone and
any transactions, connections and other temporary resources shall be
terminated.
|
long |
setResourceContent(ITransaction transaction,
String uri,
InputStream is,
String contentType,
String characterEncoding)
Sets / stores the content of the resource specified by
resourceUri. |
public LocalFileSystemStore(File root)
public void destroy()
IWebdavStoredestroy in interface IWebdavStorepublic ITransaction begin(Principal principal) throws WebdavException
IWebdavStore#commit()
or #rollback(). If only non-read methods have been called, the
request will be terminated by a #commit(). This method will be
called by (@link WebdavStoreAdapter} at the beginning of each request.begin in interface IWebdavStoreprincipal - the principal that started this request or null if
there is non availableWebdavExceptionpublic void checkAuthentication(ITransaction transaction) throws SecurityException
IWebdavStorecheckAuthentication in interface IWebdavStoretransaction - indicates that the method is within the scope of a WebDAV
transactionSecurityExceptionpublic void commit(ITransaction transaction) throws WebdavException
IWebdavStorecommit in interface IWebdavStoretransaction - indicates that the method is within the scope of a WebDAV
transactionWebdavException - if something goes wrong on the store levelpublic void rollback(ITransaction transaction) throws WebdavException
IWebdavStorerollback in interface IWebdavStoretransaction - indicates that the method is within the scope of a WebDAV
transactionWebdavException - if something goes wrong on the store levelpublic void createFolder(ITransaction transaction, String uri) throws WebdavException
IWebdavStorefolderUri.createFolder in interface IWebdavStoretransaction - indicates that the method is within the scope of a WebDAV
transactionuri - URI of the folderWebdavException - if something goes wrong on the store levelpublic void createResource(ITransaction transaction, String uri) throws WebdavException
IWebdavStoreresourceUri.createResource in interface IWebdavStoretransaction - indicates that the method is within the scope of a WebDAV
transactionuri - URI of the content resourceWebdavException - if something goes wrong on the store levelpublic long setResourceContent(ITransaction transaction, String uri, InputStream is, String contentType, String characterEncoding) throws WebdavException
IWebdavStoreresourceUri.setResourceContent in interface IWebdavStoretransaction - 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 or null if unknowncharacterEncoding - character encoding of the resource or null if unknown
or not applicableWebdavException - if something goes wrong on the store levelpublic String[] getChildrenNames(ITransaction transaction, String uri) throws WebdavException
IWebdavStorefolderUri.getChildrenNames in interface IWebdavStoretransaction - indicates that the method is within the scope of a WebDAV
transactionuri - URI of the foldernull if the
uri points to a fileWebdavException - if something goes wrong on the store levelpublic void removeObject(ITransaction transaction, String uri) throws WebdavException
IWebdavStoreuri.removeObject in interface IWebdavStoretransaction - indicates that the method is within the scope of a WebDAV
transactionuri - URI of the object, i.e. content resource or folderWebdavException - if something goes wrong on the store levelpublic InputStream getResourceContent(ITransaction transaction, String uri) throws WebdavException
IWebdavStoreresourceUri.getResourceContent in interface IWebdavStoretransaction - indicates that the method is within the scope of a WebDAV
transactionuri - URI of the content resourceWebdavException - if something goes wrong on the store levelpublic long getResourceLength(ITransaction transaction, String uri) throws WebdavException
IWebdavStoreresourceUri.getResourceLength in interface IWebdavStoretransaction - indicates that the method is within the scope of a WebDAV
transaction-1 declares this
value as invalid and asks the adapter to try to set it from the
properties if possibleWebdavException - if something goes wrong on the store levelpublic StoredObject getStoredObject(ITransaction transaction, String uri)
IWebdavStoreurigetStoredObject in interface IWebdavStoretransaction - indicates that the method is within the scope of a WebDAV
transactionuri - URICopyright © 2011-2013. All Rights Reserved.