org.olat.core.util.vfs
Class VirtualContainer

java.lang.Object
  extended by org.olat.core.util.vfs.AbstractVirtualContainer
      extended by org.olat.core.util.vfs.VirtualContainer
All Implemented Interfaces:
VFSContainer, VFSItem

public class VirtualContainer
extends AbstractVirtualContainer


Constructor Summary
VirtualContainer(java.lang.String name)
           
 
Method Summary
 void addItem(VFSItem vfsItem)
          Add a VFSItem to this CirtualContainer.
 VFSStatus canWrite()
           
 java.util.List getItems()
           
 java.util.List getItems(VFSItemFilter filter)
           
 VFSSecurityCallback getLocalSecurityCallback()
          Get the local security callback for this item.
 VFSContainer getParentContainer()
          Get the parent of this vfsItem.
 boolean isSame(VFSItem vfsItem)
          Test if this is the same item as ourselves.
 VFSItem resolve(java.lang.String path)
          a relative path.
 void setLocalSecurityCallback(VFSSecurityCallback secCallback)
          Set a custom security callback for this item.
 void setParentContainer(VFSContainer parentContainer)
          Sets the parent container.
 
Methods inherited from class org.olat.core.util.vfs.AbstractVirtualContainer
canCopy, canDelete, canRename, copyFrom, createChildContainer, createChildLeaf, delete, getDefaultItemFilter, getLastModified, getName, rename, setDefaultItemFilter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VirtualContainer

public VirtualContainer(java.lang.String name)
Method Detail

addItem

public void addItem(VFSItem vfsItem)
Add a VFSItem to this CirtualContainer.

Parameters:
vfsItem -

getItems

public java.util.List getItems()
Returns:
a list of VFSItem containing

getItems

public java.util.List getItems(VFSItemFilter filter)
Returns:
a list of VFSItem which are accepted by the given filter. If a default filter is set, the default filter will be applied in addition to the given filter in this method

canWrite

public VFSStatus canWrite()
Returns:
true if a child can be added at all(only files and folder cab be copied to). the operation may still fail because e.g. of quota limitation.

getLocalSecurityCallback

public VFSSecurityCallback getLocalSecurityCallback()
Description copied from interface: VFSItem
Get the local security callback for this item. NOTE: Usually you would not need to access local security callbacks directly. You'd rather want to get the inherited security callback of this item via getInheritedSecurityCallback. This will get you the local security callback if set aswell but also any inherited security callbacks from parent containers.

Returns:
SecurityCallback if any, or null if not set.
See Also:
VFSItem#getInheritedSecurityCallback()

getParentContainer

public VFSContainer getParentContainer()
Description copied from interface: VFSItem
Get the parent of this vfsItem.

Returns:

isSame

public boolean isSame(VFSItem vfsItem)
Description copied from interface: VFSItem
Test if this is the same item as ourselves.

Returns:

resolve

public VFSItem resolve(java.lang.String path)
Description copied from interface: VFSItem
a relative path. the implementation will search all its children. e.g. bla/blu/bli.txt this vfsitem's name must thus be 'bla'

Returns:

setLocalSecurityCallback

public void setLocalSecurityCallback(VFSSecurityCallback secCallback)
Description copied from interface: VFSItem
Set a custom security callback for this item.


setParentContainer

public void setParentContainer(VFSContainer parentContainer)
Description copied from interface: VFSItem
Sets the parent container. -> DO NOT CALL THIS METHOD... USED ONLY INTERNALLY!