org.olat.core.util.vfs
Class LocalImpl

java.lang.Object
  extended by org.olat.core.util.vfs.LocalImpl
All Implemented Interfaces:
VFSItem
Direct Known Subclasses:
LocalFileImpl, LocalFolderImpl

public abstract class LocalImpl
extends java.lang.Object
implements VFSItem

Description:
TODO: Felix Jost Class Description for LocalImpl

Initial Date: 23.06.2005

Author:
Felix Jost

Method Summary
 VFSStatus canCopy()
           
 VFSStatus canDelete()
           
 VFSStatus canRename()
           
 VFSStatus canWrite()
           
abstract  VFSStatus delete()
          deltes the item.
 java.io.File getBasefile()
          Be aware that the returned base file reference might change, do not hold a local reference to it in your code! Due to a bug in Java after renaming a LocalImpl file the base file will be a new object with a new reference!
 long getLastModified()
          Return the last modified date of this item or -1 if not available.
 VFSSecurityCallback getLocalSecurityCallback()
          Get the local security callback for this item.
 java.lang.String getName()
           
 VFSContainer getParentContainer()
          Get the parent of this vfsItem.
 boolean isSame(VFSItem vfsItem)
          Test if this is the same item as ourselves.
abstract  VFSStatus rename(java.lang.String newname)
           
 void setLocalSecurityCallback(VFSSecurityCallback securityCallback)
          Set a custom security callback for this item.
 void setParentContainer(VFSContainer parentContainer)
          Sets the parent container.
 
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.VFSItem
resolve
 

Method Detail

getParentContainer

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

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

setParentContainer

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

Specified by:
setParentContainer in interface VFSItem
See Also:
VFSItem.setParentContainer(org.olat.core.util.vfs.VFSContainer)

canDelete

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

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()

canRename

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

canWrite

public VFSStatus canWrite()
Specified by:
canWrite in interface VFSItem
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.
See Also:
VFSItem.canWrite()

getName

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

getBasefile

public java.io.File getBasefile()
Be aware that the returned base file reference might change, do not hold a local reference to it in your code! Due to a bug in Java after renaming a LocalImpl file the base file will be a new object with a new reference!

Returns:
the current base file

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:
lmd

rename

public abstract 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 abstract 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()

setLocalSecurityCallback

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

Specified by:
setLocalSecurityCallback in interface VFSItem
See Also:
org.olat.core.util.vfs.VFSItem#setSecurityCallback(org.olat.core.util.vfs.callbacks.VFSSecurityCallback)

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.

Specified by:
getLocalSecurityCallback in interface VFSItem
Returns:
SecurityCallback if any, or null if not set.
See Also:
VFSItem.getLocalSecurityCallback()

isSame

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

Specified by:
isSame in interface VFSItem
Returns:
See Also:
VFSItem.isSame(org.olat.core.util.vfs.VFSItem)