|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.uva.vlet.vrs.VNode
nl.uva.vlet.vfs.VFSNode
nl.uva.vlet.vfs.VDir
public abstract class VDir
Super class of the VFS Directory implementation. Represents an abstract interface to a Directory implementation.
VFile
,
VFSNode
Field Summary |
---|
Fields inherited from class nl.uva.vlet.vfs.VFSNode |
---|
ATTR_ACCESS_TIME, ATTR_CREATION_TIME, ATTR_DATA_TYPE, ATTR_DIRNAME, ATTR_EXISTS, ATTR_GID, ATTR_GROUP, ATTR_ISDIR, ATTR_ISFILE, ATTR_ISHIDDEN, ATTR_ISREADABLE, ATTR_ISSOFTLINK, ATTR_ISWRITABLE, ATTR_LENGTH, ATTR_LINKTARGET, ATTR_MODIFICATION_TIME, ATTR_NRACLENTRIES, ATTR_NRCHILDS, ATTR_OWNER, ATTR_PARENT_DIRNAME, ATTR_PERMISSIONS_STRING, ATTR_RESOURCE, ATTR_UID, ATTR_UNIQUE, attributeNames, defaultStreamBufferSize |
Fields inherited from class nl.uva.vlet.vrs.VNode |
---|
ATTR_CHARSET, ATTR_HOSTNAME, ATTR_ICON, ATTR_ISVLINK, ATTR_LOCATION, ATTR_MIMETYPE, ATTR_NAME, ATTR_PATH, ATTR_PORT, ATTR_SCHEME, ATTR_TYPE, location, vrsContext |
Fields inherited from interface nl.uva.vlet.vfs.VACL |
---|
GROUP_ENTITY, PERM_ACCESSABLE, PERM_EXECUTABLE, PERM_READABLE, PERM_WRITABLE, USER_ENTITY, WORLD_ENTITY |
Constructor Summary | |
---|---|
VDir(VRSContext context,
VRL vrl)
|
Method Summary | |
---|---|
VFSNode |
addNode(VFSNode node,
java.lang.String optNewName,
boolean isMove)
|
VFSNode |
addNode(VNode node,
boolean isMove)
Add (VFS)Node to this directory location. |
VFSNode |
addNode(VNode node,
java.lang.String optNewName,
boolean isMove)
Add a node to the underlaying Resource with a optional new name. |
VFSNode[] |
addNodes(VFSNode[] nodes,
boolean isMove)
|
VNode[] |
addNodes(VNode[] nodes,
boolean isMove)
Add mutiple (VFS)Nodes to this directory location. |
VFSTransfer |
asyncDownload(VNode source,
java.lang.String optNewName,
boolean isMove)
Asynchronous transfer method to download an Resource Returns VFSTransfer info object so the transfer can be monitored. |
VDir |
copyTo(VDir dest)
Copy/Move to specified location is called by VFSClient.copyDir() ... |
VDir |
copyTo(VDir dest,
java.lang.String newName)
Copy/Move to specified location is called by VFSClient.copyDir() ... |
VFSNode |
createChild(java.lang.String type,
java.lang.String name,
boolean force)
VDir implements createChild by calling createFile and createDir, depending on the type. |
VDir |
createDir(java.lang.String subdirName)
Create subdirectory. |
abstract VDir |
createDir(java.lang.String name,
boolean ignoreExisting)
Creates subdirectory in this directory. |
VFile |
createFile(java.lang.String name)
Create file in this Virtual Directory. |
abstract VFile |
createFile(java.lang.String name,
boolean force)
Create file in this Virtual Directory. |
protected static VDir |
defaultCopyMove(VFSTransfer transfer,
VDir source,
VDir dest,
java.lang.String optNewName,
boolean isMove)
Default Copy/Move: performs recursive copy of a directory. lists children and performs cmoveTo on childs. protected: may only be used by subclasses if they do not have an optimized CopyMoveTo themselfs. |
protected static boolean |
defaultRecursiveDeleteChildren(VDir dir)
Default Recursive delete: lists children and perform delete() on child list. |
boolean |
delete()
Non-recursive Delete. Calles recursive delete from VComposite with resurse=false. |
boolean |
delNode(VNode childNode)
Delete node. |
boolean |
delNodes(VNode[] childNodes)
Delete nodes. |
protected VDir |
doCopyMoveTo(VFSTransfer transfer,
VDir dest,
java.lang.String optNewName,
boolean isMove)
Default implementation to do actual copy/move. |
VFile |
downloadNode(VNode node,
java.lang.String optNewName,
boolean isMove)
Create new VFile and copies contents from (VStreamreadable) vnode. |
protected VDir |
downloadTo(VFSTransfer transfer,
VDir localDir,
java.lang.String optNewName,
boolean isMove)
Default implementation to download this directory. |
abstract boolean |
existsDir(java.lang.String fileName)
returns true whether child exists and is a VDir |
abstract boolean |
existsFile(java.lang.String fileName)
returns true whether child exists and is a VFile |
VFSNode |
getChild(java.lang.String name)
Get VFSNode |
VAttribute[][] |
getChildAttributes(java.lang.String[] names)
Returns attributes for all childs |
VAttribute[][] |
getChildAttributes(java.lang.String[] childNames,
java.lang.String[] names)
Return attribute matrix for given nodes. |
VFSNode[] |
getChilds()
default implementation calls the VDir method list() |
VDir |
getDir(java.lang.String dirname)
Get subdirectory |
VFile |
getFile(java.lang.String name)
Get file in this directory |
VRL |
getHelp()
Returns simple text file or complete HTML page. |
java.lang.String[] |
getResourceTypes()
Returns allowed child types for VDir. The default types for VDir are 'File' and 'Dir' type |
java.lang.String |
getType()
Returns resource type, if it has one |
boolean |
hasChild(java.lang.String name)
Checks whether this node has a child with the specified name |
boolean |
isAccessable()
Override this method if your directory can be accessable but not be 'readable'. |
boolean |
isDir()
return true if the VFSNode is a (V)Directory |
boolean |
isFile()
return true if the VFSNode is a (V)File |
abstract VFSNode[] |
list()
This method is Similar to getChilds, but returns an array of VFSNodes. The method getChilds returns an array of type VNode. |
VFSNode[] |
listSorted(boolean typeFirst,
boolean ignoreCase)
List the chidren and sorts them. |
VDir |
moveTo(VDir dest)
Move to specified VDir location. |
VDir |
moveTo(VDir dest,
java.lang.String newName)
Move to specified VDir location. |
VDir |
putDir(VDir dir)
Put Directory (copy) Directory to this Directory is called by VFSClient.copyDir() ... |
VDir |
putDir(VDir dir,
java.lang.String optNewName)
Put Directory (copy) Directory to this Directory is called by VFSClient.copyDir() ... |
VFile |
putFile(VFile file)
Put File (copy) to this directory is called by VFSClient.copyDir() ... |
VFile |
putFile(VFile file,
java.lang.String optNewName)
Put File (copy) to this directory is called by VFSClient.copyDir() ... |
protected VDir |
uploadLocalDir(VFSTransfer transfer,
VDir localDir,
java.lang.String optNewName,
boolean isMove)
Default implementation to upload a directory. |
protected VFile |
uploadLocalFile(VFSTransfer transfer,
VFile localFile,
java.lang.String optNewName,
boolean isMove)
Default implementation to upload a local file to this directory. |
Methods inherited from class nl.uva.vlet.vfs.VFSNode |
---|
asyncCopyMoveTo, create, createACLRecord, createTransfer, createTransferTo, deleteACLEntity, exists, getACL, getACLEntities, getAttribute, getAttributeNames, getLinkTarget, getLinkTargetVRL, getModificationTime, getParent, getParents, getPath, getPermissionsString, getRoot, getTranferInfo, isDeletable, isEditable, isHidden, isLink, isLocal, isRandomAccessable, isReadable, isRenamable, isWritable, returnAsArray, setACL, setAttribute, setAttributes, startCopyMoveTo, startCopyMoveTo |
Methods inherited from class nl.uva.vlet.vrs.VNode |
---|
compareTo, getAttributes, getAttributes, getAttributeSet, getBasename, getCharSet, getHostname, getIconURL, getID, getLocation, getMimeType, getName, getPath, getPort, getScheme, getServerAttributes, getURI, getVRL, getVRSContext, isComposite, isVirtual, isVLink, mergedGetAttributes, setLocation, setVRL, toLinkNode, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface nl.uva.vlet.vrs.VComposite |
---|
delete, getNrOfChilds, isDeletable |
Methods inherited from interface nl.uva.vlet.vrs.VRenamable |
---|
isRenamable, renameTo |
Constructor Detail |
---|
public VDir(VRSContext context, VRL vrl)
Method Detail |
---|
public VRL getHelp()
VNode
getHelp
in class VNode
public java.lang.String getType()
VNode
getType
in class VNode
public java.lang.String[] getResourceTypes()
getResourceTypes
in interface VComposite
public VFSNode addNode(VNode node, boolean isMove) throws VlException
addNode
in interface VComposite
VlException
public VFSNode addNode(VNode node, java.lang.String optNewName, boolean isMove) throws VlException
VComposite
For optimization the isMove determines if it is a move, so the implementation can optimize local movements for example on the same filesystems or on the same SRB Server.
addNode
in interface VComposite
VlException
public VFile downloadNode(VNode node, java.lang.String optNewName, boolean isMove) throws VlException
VlException
public VFSTransfer asyncDownload(VNode source, java.lang.String optNewName, boolean isMove) throws VlException
VlException
public VFSNode addNode(VFSNode node, java.lang.String optNewName, boolean isMove) throws VlException
VlException
public VNode[] addNodes(VNode[] nodes, boolean isMove) throws VlException
addNodes
in interface VComposite
VlException
public VFSNode[] addNodes(VFSNode[] nodes, boolean isMove) throws VlException
VlException
public boolean delNode(VNode childNode) throws VlException
delNode
in interface VComposite
VlException
public boolean delNodes(VNode[] childNodes) throws VlException
delNodes
in interface VComposite
VlException
public boolean isFile()
isFile
in class VFSNode
VFile
public boolean isDir()
isDir
in class VFSNode
VDir
public VFSNode[] getChilds() throws VlException
getChilds
in interface VComposite
VlException
public VFSNode createChild(java.lang.String type, java.lang.String name, boolean force) throws VlException
createChild
in interface VComposite
type
- must be on of the types getResourceTypes() returns.name
- may be null. The implementation might choose a default name
or prompt the user.force
- means to create the child even if it already exists.
VlException
public VFile createFile(java.lang.String name) throws VlException
VlException
public VDir createDir(java.lang.String subdirName) throws VlException
VlException
public final VFile putFile(VFile file) throws VlException
VlException
public final VFile putFile(VFile file, java.lang.String optNewName) throws VlException
VlException
public final VDir putDir(VDir dir) throws VlException
VlException
public final VDir putDir(VDir dir, java.lang.String optNewName) throws VlException
VlException
public final VDir copyTo(VDir dest) throws VlException
copyTo
in class VFSNode
VlException
public final VDir copyTo(VDir dest, java.lang.String newName) throws VlException
copyTo
in class VFSNode
VlException
public final VDir moveTo(VDir dest) throws VlException
moveTo
in class VFSNode
VlException
public final VDir moveTo(VDir dest, java.lang.String newName) throws VlException
moveTo
in class VFSNode
VlException
public boolean delete() throws VlException
delete
in interface VEditable
VlException
nl.uva.vlet.vrs.VNode#delete()
,
nl.uva.vlet.vrs.VComposite#delete()
public VDir getDir(java.lang.String dirname) throws VlException
VlException
public VFile getFile(java.lang.String name) throws VlException
VlException
public VFSNode getChild(java.lang.String name) throws VlException
getChild
in interface VComposite
VlException
public boolean hasChild(java.lang.String name) throws VlException
VComposite
hasChild
in interface VComposite
VlException
public VAttribute[][] getChildAttributes(java.lang.String[] childNames, java.lang.String[] names) throws VlException
getChildAttributes
in interface VComposite
childs
- array of VNodesnames
-
VlException
public VAttribute[][] getChildAttributes(java.lang.String[] names) throws VlException
VComposite
getChildAttributes
in interface VComposite
VlException
public boolean isAccessable() throws VlException
VComposite
isAccessable
in interface VComposite
VlException
protected VDir doCopyMoveTo(VFSTransfer transfer, VDir dest, java.lang.String optNewName, boolean isMove) throws VlException
This Dir Remote Destination method local remote VDir.uploadDir remote local VDir.downloadTo local local streamcopy remote other remote streamcopy [ ... move on same server ... ] VDir.renameTo
transfer
-
VlException
moveTo(VDir)
,
copyTo(VDir)
,
uploadDir(VDir)
,
uploadFIle(VFile)
protected VFile uploadLocalFile(VFSTransfer transfer, VFile localFile, java.lang.String optNewName, boolean isMove) throws VlException
Override this method if the VFS implementation has a more efficient (bulk/parallel) upload method for files.
protected: use copyTo/moveTo or doCopyMoveTo
VlException
protected VDir uploadLocalDir(VFSTransfer transfer, VDir localDir, java.lang.String optNewName, boolean isMove) throws VlException
This method is used by Local Directories to upload themself. Override this method if the VFS implementation has a more efficient (bulk) upload method for directories.
VlException
protected VDir downloadTo(VFSTransfer transfer, VDir localDir, java.lang.String optNewName, boolean isMove) throws VlException
Override this method if the VFS implementation has a more efficient (bulk) download method.
VlException
protected static boolean defaultRecursiveDeleteChildren(VDir dir) throws VlException
dir
-
VlException
protected static VDir defaultCopyMove(VFSTransfer transfer, VDir source, VDir dest, java.lang.String optNewName, boolean isMove) throws VlException
VlException
public VFSNode[] listSorted(boolean typeFirst, boolean ignoreCase) throws VlException
if
- typeFirst==true return directories first, then files.ignoreCase
- ignore case when sorting
VlException
public abstract VDir createDir(java.lang.String name, boolean ignoreExisting) throws VlException
mustnotexist=true and
the directory already exists.
- Throws:
VlException
public abstract boolean existsFile(java.lang.String fileName) throws VlException
VlException
public abstract boolean existsDir(java.lang.String fileName) throws VlException
VlException
public abstract VFile createFile(java.lang.String name, boolean force) throws VlException
VlException
public abstract VFSNode[] list() throws VlException
VlException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |