nl.uva.vlet.vrs
Interface VRenamable

All Known Implementing Classes:
LinkNode, ResourceNode, VDir, VFile, VFSNode

public interface VRenamable

The Renameable Interface.
If a resource is renameable it implements this interface.


Method Summary
 boolean isRenamable()
          Returns true is the resource is renamble whit the current credentials.
 boolean renameTo(java.lang.String newName, boolean nameIsPath)
          Renames this resource.
Since for some implementations (java.io.File) a full path is needed.
 

Method Detail

renameTo

boolean renameTo(java.lang.String newName,
                 boolean nameIsPath)
                 throws VlException
Renames this resource.
Since for some implementations (java.io.File) a full path is needed. The parameter nameIsPath specifies whether only the basename (last part of path) or the full path is given as new name to avoid this ambiguoty !
For java.io.file a renameTo can also be used as a move !

Parameters:
newName - New basename or fullpath of new filename
nameIsPath - whether the 'name' is an absolute path
Returns:
Throws:
VlException

isRenamable

boolean isRenamable()
                    throws VlException
Returns true is the resource is renamble whit the current credentials. When false is returned, this doesn't mean this resource isn't renamable in general (if not, this interface wouldn't be implemented) just that the current permission prohobit it. Default implementation for a VFSNode is to check whether it is writable.

Returns:
true if the current user can rename this resource.
Throws:
VlException
See Also:
VFSNode.isRenamable();