com.ibm.portal.resolver.webdav.tree
Interface WebdavTreeModelController<T,M extends Modifiable>

All Superinterfaces:
Committable, Disposable, WebdavTreeModel<T>
All Known Subinterfaces:
WebdavCopyableTreeModelController<T,M>, WebdavLockableTreeModelController<T,M>, WebdavRenameableTreeModelController<T,M>
All Known Implementing Classes:
DefaultWebdavTreeModelController

public interface WebdavTreeModelController<T,M extends Modifiable>
extends WebdavTreeModel<T>, Committable

Interface that allows to modify hierarchical resources via WebDAV

Since:
6.1.5
Note:
This interface is designed to be implemented by clients.

Field Summary
static boolean FLAG_COLLECTION
          flag into the creation context to indicate that the new item is a collection
static boolean FLAG_FILE
          flag into the creation context to indicate that the new item is a file
 
Method Summary
 WebdavCreationContext<T> createCreationContext(java.lang.String name, boolean isCollection, java.io.InputStream is, T parent)
          Returns a new creation context to create a new item inside a parent collection.
 TreeModelController<T,M> getTreeModelController()
          Creates a new CommittableTreeModelController used to execute modification operations on the tree.
 boolean update(M item, java.io.InputStream is)
          This method updates the modifiable item with the content of the input stream.
 
Methods inherited from interface com.ibm.portal.resolver.webdav.tree.WebdavTreeModel
createDataSource, getItem, getLocalized, getName, getTreeModel, isCollection
 
Methods inherited from interface com.ibm.portal.Committable
commit, dispose
 

Field Detail

FLAG_COLLECTION

static final boolean FLAG_COLLECTION
flag into the creation context to indicate that the new item is a collection

See Also:
Constant Field Values

FLAG_FILE

static final boolean FLAG_FILE
flag into the creation context to indicate that the new item is a file

See Also:
Constant Field Values
Method Detail

createCreationContext

WebdavCreationContext<T> createCreationContext(java.lang.String name,
                                               boolean isCollection,
                                               java.io.InputStream is,
                                               T parent)
                                               throws java.io.IOException
Returns a new creation context to create a new item inside a parent collection. Depending on the isCollection parameter the new item can contain subitems or not.

Parameters:
name - name of the new collection or item, not null. The name will not contain the path separator '/' and will not be URL encoded.
isCollection - true if the new item is a collection, else false
is - in case a non-collection is created this stream contains the content of the newly created item and will not be null. In case a collection is created, this stream may be null or contains the optional request body of the MKCOL request.
parent - the parent collection, not null. This information can be used as a hint for the target insert location. In any case the new node will be explicitly inserted as the child of the parent collection after it has been created.
Returns:
a creation context or null
Throws:
java.io.IOException

getTreeModelController

TreeModelController<T,M> getTreeModelController()
Creates a new CommittableTreeModelController used to execute modification operations on the tree. If no modifications are allowed, this method may return null

Returns:
the controller or null

update

boolean update(M item,
               java.io.InputStream is)
               throws java.io.IOException
This method updates the modifiable item with the content of the input stream. If the update is successful, the method returns true , else it returns false. After a successful update the new content of the item must be available via the WebdavTreeModel.createDataSource(T) APIs.

Parameters:
item - item to update, not null
is - the (new) content of the item, not null
Returns:
true if the operation was successful, else false
Throws:
java.io.IOException