org.olat.core.util.vfs
Class AbstractVirtualContainer

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

public abstract class AbstractVirtualContainer
extends java.lang.Object
implements VFSContainer

Description:
TODO: Felix Jost Class Description for VirtualContainer

Initial Date: 23.06.2005

Author:
Felix Jost

Constructor Summary
AbstractVirtualContainer()
          constructor for anynomous types
AbstractVirtualContainer(java.lang.String name)
           
 
Method Summary
 VFSStatus canCopy()
           
 VFSStatus canDelete()
           
 VFSStatus canRename()
           
 VFSStatus copyFrom(VFSItem vfsItem)
          copy either a file or a folder to this folder.
 VFSContainer createChildContainer(java.lang.String name)
          Create a new child container (of same type) if possible.
 VFSLeaf createChildLeaf(java.lang.String name)
          Create a new leaf (of same type) if possible,
 VFSStatus delete()
          deltes the item.
 VFSItemFilter getDefaultItemFilter()
           
 long getLastModified()
          Return the last modified date of this item or -1 if not available.
 java.lang.String getName()
           
 VFSStatus rename(java.lang.String newname)
           
 void setDefaultItemFilter(VFSItemFilter defaultFilter)
          Set a default filter that will be applied to this container getItems method
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.olat.core.util.vfs.VFSContainer
getItems, getItems
 
Methods inherited from interface org.olat.core.util.vfs.VFSItem
canWrite, getLocalSecurityCallback, getParentContainer, isSame, resolve, setLocalSecurityCallback, setParentContainer
 

Constructor Detail

AbstractVirtualContainer

public AbstractVirtualContainer(java.lang.String name)
Parameters:
name -

AbstractVirtualContainer

public AbstractVirtualContainer()
constructor for anynomous types

Method Detail

canDelete

public VFSStatus canDelete()
Specified by:
canDelete in interface VFSItem
Returns:
if can delete
See Also:
VFSItem.canDelete()

canRename

public VFSStatus canRename()
Specified by:
canRename in interface VFSItem
Returns:
if can write
See Also:
VFSItem.canRename()

canCopy

public VFSStatus canCopy()
Specified by:
canCopy in interface VFSItem
Returns:
true if this container (and all its children recursively) can be copied to some other place. this is normally true for containers with a physical implementation, but not for virtual/named containers
See Also:
VFSItem.canCopy()

copyFrom

public VFSStatus copyFrom(VFSItem vfsItem)
Description copied from interface: VFSContainer
copy either a file or a folder to this folder. e.g. this folder is based at /bla/blu, copying source bli (from /whatever/bli) will add a child bli, so it looks like /bla/blu/bli later. the operation fails when the source or target do not support canCopyFrom and canCopyTo, resp., or there is already a child with the same name, or the quota would be exceeded.

Specified by:
copyFrom in interface VFSContainer
Parameters:
vfsItem - the source (must exist)
Returns:
the status
See Also:
VFSContainer.copyFrom(org.olat.core.util.vfs.VFSItem)

getName

public java.lang.String getName()
Specified by:
getName in interface VFSItem
Returns:
the name
See Also:
VFSItem.getName()

getLastModified

public long getLastModified()
Description copied from interface: VFSItem
Return the last modified date of this item or -1 if not available.

Specified by:
getLastModified in interface VFSItem
Returns:
See Also:
VFSItem.getLastModified()

rename

public VFSStatus rename(java.lang.String newname)
Specified by:
rename in interface VFSItem
Parameters:
newname - e.g test.txt or myfolder (no path prepended)
Returns:
status
See Also:
VFSItem.rename(java.lang.String)

delete

public VFSStatus delete()
Description copied from interface: VFSItem
deltes the item. if the item is a container, all children will be deleted recursively

Specified by:
delete in interface VFSItem
Returns:
status
See Also:
VFSItem.delete()

createChildContainer

public VFSContainer createChildContainer(java.lang.String name)
Description copied from interface: VFSContainer
Create a new child container (of same type) if possible.

Specified by:
createChildContainer in interface VFSContainer
Returns:
VFSItem if successfull, null otherwise.
See Also:
VFSContainer.createChildContainer(java.lang.String)

createChildLeaf

public VFSLeaf createChildLeaf(java.lang.String name)
Description copied from interface: VFSContainer
Create a new leaf (of same type) if possible,

Specified by:
createChildLeaf in interface VFSContainer
Returns:
VFSItem if successfull, null otherwise.
See Also:
VFSContainer.createChildLeaf(java.lang.String)

setDefaultItemFilter

public void setDefaultItemFilter(VFSItemFilter defaultFilter)
Description copied from interface: VFSContainer
Set a default filter that will be applied to this container getItems method

Specified by:
setDefaultItemFilter in interface VFSContainer
See Also:
VFSContainer.setDefaultItemFilter(org.olat.core.util.vfs.filters.VFSItemFilter)

getDefaultItemFilter

public VFSItemFilter getDefaultItemFilter()
Specified by:
getDefaultItemFilter in interface VFSContainer
Returns:
The default filter for this container or NULL if no filter is set
See Also:
VFSContainer.getDefaultItemFilter()