dk.apaq.vfs
Interface Node

All Superinterfaces:
Comparable, Serializable
All Known Subinterfaces:
Directory, File
All Known Implementing Classes:
CifsDirectory, CifsFile, CifsNode, LayeredDirectory, LayeredFile, LayeredNode, NativeDirectory, NativeFile, NativeNode, RamDirectory, RamFile, RamNode, SftpDirectory, SftpFile, SftpNode, SubDirectory, SubFile, SubNode

public interface Node
extends Comparable, Serializable

Author:
mzk

Method Summary
 boolean canRead()
          Retrieves information about wether access to read is allowed.
 boolean canWrite()
          Retrieves information about wether access to read is allowed.
 int compareTo(Node node)
          Compare this node to another node by comparing their names.
 void delete()
          Deletes the node.
 boolean equals(Node node)
           
 String getBaseName()
          Retrieves the name without suffix like this: myimage.jpg = myimage mybundle.app = mybundle testfile.dit.dat = testfile.dit testdir = testdir
 FileSystem getFileSystem()
          Retrieves the filesystem which this node belongs to.
 Date getLastModified()
          Retrieves the date for last modification.
 String getName()
          Retrieves the name of the node.
 Directory getParent()
          Retrieves the parent directory of this node.
 Path getPath()
           
 String getSuffix()
          Retrieves the suffix of the node or null if no suffix, like this:.
 boolean isDirectory()
          Checks wether this node is a directory.
 boolean isFile()
          Checks wether this node is a file.
 boolean isHidden()
          Checks wether this node is hidden.
 void moveTo(Directory newParent)
          Moves this node to a new directory.
 void moveTo(Directory newParent, String newName)
          Moves this node to a new directory and renames it.
 void setLastModified(Date date)
          Sets the date for last modification.
 void setName(String name)
          Renames the node.
 URI toUri()
           
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

moveTo

void moveTo(Directory newParent)
            throws IOException
Moves this node to a new directory.

Parameters:
newParent - The directory the node should be moved to.
Throws:
IOException - Thrown if an error occurs while the node is being moved.

moveTo

void moveTo(Directory newParent,
            String newName)
            throws IOException
Moves this node to a new directory and renames it.

Parameters:
newParent - The directory the node should be moved to.
newName - The new name of the node.
Throws:
IOException - Thrown if an error occurs while the node is being moved or renamed.

setName

void setName(String name)
             throws IOException
Renames the node.

Parameters:
name - The new name of the node.
Throws:
IOException - Thrown if an error occurs while renaming the node.

getName

String getName()
Retrieves the name of the node.

Returns:

getBaseName

String getBaseName()
Retrieves the name without suffix like this: myimage.jpg = myimage mybundle.app = mybundle testfile.dit.dat = testfile.dit testdir = testdir

Returns:
The nodes basename.

getSuffix

String getSuffix()
Retrieves the suffix of the node or null if no suffix, like this:. myimage.jpg = jpg mybundle.app = app testfile.dit.dat = dat testdir =

Returns:
The suffix or null.

getParent

Directory getParent()
                    throws FileNotFoundException
Retrieves the parent directory of this node.

Returns:
The parent directory.
Throws:
FileNotFoundException - Thrown if parent directory could not be found - would normally only occur if called on the root directory.

getFileSystem

FileSystem getFileSystem()
Retrieves the filesystem which this node belongs to.

Returns:
The filesystem.

isDirectory

boolean isDirectory()
Checks wether this node is a directory.

Returns:
True/False wether this node is a directory.

isFile

boolean isFile()
Checks wether this node is a file.

Returns:
True/False wether this node is a file.

isHidden

boolean isHidden()
Checks wether this node is hidden.

Returns:
True/False if this node is hidden.

getLastModified

Date getLastModified()
Retrieves the date for last modification.

Returns:
The date for alst modification.

setLastModified

void setLastModified(Date date)
Sets the date for last modification.

Parameters:
date - The date.

compareTo

int compareTo(Node node)
Compare this node to another node by comparing their names.

Parameters:
node - The node to compare with.
Returns:
The returnvalue of the comparison of the to nodes names.

delete

void delete()
            throws IOException
Deletes the node.

Throws:
IOException - Thrown if an error occurs during deletion.

toUri

URI toUri()

equals

boolean equals(Node node)

getPath

Path getPath()

canRead

boolean canRead()
Retrieves information about wether access to read is allowed. It should also check via the native filesystem if possible.

Returns:
True/False

canWrite

boolean canWrite()
Retrieves information about wether access to read is allowed. It should also check via the native filesystem if possible.

Returns:
True/False


Copyright © 2011. All Rights Reserved.