com.gubutech.xload
Interface XloadDirectoryItem

All Known Implementing Classes:
XloadDirectory, XloadFile

public interface XloadDirectoryItem

Interface that represents either an XloadFile or an XloadDirectory inside some directory.

Since:
1.1

Method Summary
 boolean delete()
          Deletes this XloadDirectoryItem.
 boolean equals(java.lang.Object o)
          Determines whether or not an object passed as a parameter is either an XloadFile or an XloadDirectory object and represents the same file or directory as this object does.
 boolean exists()
          Determines whether this XloadDirectoryItem, whether it is an XloadFile or an XloadDirectory, exists or not.
 boolean isDeleted()
          Determines if the file or directory represented by this XloadDirectoryItem object has been deleted or not.
 boolean isDirectory()
          Determines whether or not this directory item represents a directory or not.
 boolean isFile()
          Determines whether or not this directory item represents a file or not.
 

Method Detail

isFile

public boolean isFile()
Determines whether or not this directory item represents a file or not.

Returns:
Returns true if this directory item is a file represented as an XloadFile object, false otherwise.
Since:
1.1

isDirectory

public boolean isDirectory()
Determines whether or not this directory item represents a directory or not.

Returns:
Returns true if this directory item is a directory represented as an XloadDirectory object, false otherwise.
Since:
1.1

delete

public boolean delete()
Deletes this XloadDirectoryItem.

Returns:
Returns true if this objects represented file or directory has been successfully deleted and false if this objects represented file or directory cannot be deleted, which maybe due to operating system access permissions.
Throws:
java.lang.SecurityException - Thrown if a there is a problem accessing the underlying file or directory on the file system with regard to permissions set by any existing SecurityManager.
Since:
1.1

isDeleted

public boolean isDeleted()
Determines if the file or directory represented by this XloadDirectoryItem object has been deleted or not.

Returns:
Returns true if the file or directory represented by this XloadDirectoryItem object has been deleted, false otherwise.
Since:
1.1

equals

public boolean equals(java.lang.Object o)
Determines whether or not an object passed as a parameter is either an XloadFile or an XloadDirectory object and represents the same file or directory as this object does.

Parameters:
o - Object to be tested for equality.
Returns:
Returns true if this object is equal to the object represented by the parameter o, false otherwise; In the case whereby this object is an XloadDirectory object, o is only equal, if and only if, it is an instance of XloadDirectory and it represents exactly the same directory on the file system as this objects represented directory such that -

this.directory.equals(o.directory) (where directory is of type java.io.File)

In the case whereby this object is an XloadFile object, o is only equal, if and only if, it is an instance of XloadFile and it represents exactly the same file on the file system, as this objects represented file such that -

this.file.equals(o.file) (where file is of type java.io.File)

In the case of a memory based file then the two objects are tested for equality using the default equals() method, provided by the object Object and are equal such that -

super.equals(o)

Throws:
java.lang.SecurityException - Thrown if there is a problem accessing files or directories on the file system with regard to permissions set by the SecurityManager.
Since:
1.1

exists

public boolean exists()
Determines whether this XloadDirectoryItem, whether it is an XloadFile or an XloadDirectory, exists or not.

Returns:
Returns true if the file or directory represented by this XloadDirectoryItem object exists, false otherwise.
Throws:
java.lang.SecurityException - Thrown if there is a problem accessing files or directories on the file system with regard to permissions set by the SecurityManager.
Since:
1.1