au.com.prunge.jgenfile
Interface Item

All Known Subinterfaces:
Directory, File, Link
All Known Implementing Classes:
AbstractItem, LocalDirectory, LocalFile, LocalItem, RelativePath.ParentItem

public interface Item

An item represents a file or directory in a file system. Usually items will implement either the File or Directory interfaces.

Version:
1.0
Author:
Peter Runge

Method Summary
 au.com.prunge.jgenfile.CanCopyItemOperation createCanCopyItemOperation()
          Creates an operation that tests whether this item can be copied.
 au.com.prunge.jgenfile.CanCopyItemToDestinationOperation createCanCopyItemToDestinationOperation(au.com.prunge.jgenfile.Directory destination)
          Creates an operation that tests whether this item can be copied into the specified directory keeping its current name.
 au.com.prunge.jgenfile.CanCopyItemToDestinationOperation createCanCopyItemToDestinationOperation(au.com.prunge.jgenfile.Directory destination, String newName)
          Creates an operation that tests whether this item can be copied into the specified directory using the specified name.
 au.com.prunge.jgenfile.CanDeleteItemOperation createCanDeleteOperation()
          Creates an operation that tests whether this item can be deleted.
 au.com.prunge.jgenfile.CanGetAbsolutePathOperation createCanGetAbsolutePathOperation()
          Creates an operation that tests whether the absolute path of this item can be acquired.
 au.com.prunge.jgenfile.CanGetMetadataOperation createCanGetMetadataOperation(Set metadataKeySet)
          Creates an operation that tests whether the specified metadata is accessible for this item.
 au.com.prunge.jgenfile.CanGetParentOperation createCanGetParentOperation()
          Creates an operation that will test whether the parent of this item can be acquired.
 au.com.prunge.jgenfile.CanGetRelativePathOperation createCanGetRelativePathOperation(au.com.prunge.jgenfile.Directory toAncestor)
          Creates an operation that tests whether the relative path of this item up to and including toAncestor can be acquired.
 au.com.prunge.jgenfile.CanSetMetadataOperation createCanSetMetadataOperation(Set metadataKeySet)
          Creates an operation that tests whether the specified metadata can be set for this item.
 au.com.prunge.jgenfile.CanSetNameOperation createCanSetNameOperation()
          Creates an operation that tests whether the name of this item can be changed.
 au.com.prunge.jgenfile.CanSetParentOperation createCanSetParentOperation()
          Creates an operation that tests whether the parent of this item can be changed.
 au.com.prunge.jgenfile.CopyItemOperation createCopyOperation(au.com.prunge.jgenfile.Directory destination)
          Creates an operation that copies this item to the specified destination directory.
 au.com.prunge.jgenfile.CopyItemOperation createCopyOperation(au.com.prunge.jgenfile.Directory destination, String newName)
          Creates an operation that copies this item to the specified destination directory giving the copied item a name of newName.
 au.com.prunge.jgenfile.DeleteItemOperation createDeleteItemOperation()
          Creates an operation that will delete this item.
 au.com.prunge.jgenfile.GetAbsolutePathOperation createGetAbsolutePathOperation()
          Creates an operation that gets the absolute path of this item.
 au.com.prunge.jgenfile.GetMetadataOperation createGetAllMetadataOperation()
          Creates an operation that acquires all available metadata for this item.
 au.com.prunge.jgenfile.GetAllMetadataKeysOperation createGetMetadataKeysOperation()
          Creates an operation that gets all the keys for the metadata of this item.
 au.com.prunge.jgenfile.GetMetadataOperation createGetMetadataOperation(Set metadataKeySet)
          Creates an operation that acquires the specified metadata.
 au.com.prunge.jgenfile.GetParentOperation createGetParentOperation()
          Creates an operation that will retrieve the parent of this item.
 au.com.prunge.jgenfile.GetRelativePathOperation createGetRelativePathOperation(au.com.prunge.jgenfile.Directory toAncestor)
          Creates an operation that gets the relative path of this item up to and including toAncestor.
 au.com.prunge.jgenfile.SetMetadataOperation createSetMetadataOperation(Map metadataMap)
          Creates an operation that sets the specified metadata for this item.
 au.com.prunge.jgenfile.SetNameOperation createSetNameOperation(String newName)
          Creates an operation that will set the name of this item.
 au.com.prunge.jgenfile.SetParentOperation createSetParentOperation(au.com.prunge.jgenfile.Directory parent)
          Creates an operation that will set the parent of (i.e.
 au.com.prunge.jgenfile.FileSystem getFileSystem()
          Returns the file system this item exists in.
 String getName()
          Returns the name of the item.
 

Method Detail

getName

public String getName()
               throws JGenFileException
Returns the name of the item.

Returns:
the name of the item.
Throws:
JGenFileException - if an error occurs getting the name of the item.

getFileSystem

public au.com.prunge.jgenfile.FileSystem getFileSystem()
                                                throws JGenFileException
Returns the file system this item exists in.

Returns:
the file system this item exists in.
Throws:
JGenFileException - if an error occurs.

createSetNameOperation

public au.com.prunge.jgenfile.SetNameOperation createSetNameOperation(String newName)
                                                               throws JGenFileException
Creates an operation that will set the name of this item.

Parameters:
newName - the new name of the item.
Throws:
JGenFileException - if the operation could not be created.

createCanSetNameOperation

public au.com.prunge.jgenfile.CanSetNameOperation createCanSetNameOperation()
                                                                     throws JGenFileException
Creates an operation that tests whether the name of this item can be changed.

Throws:
JGenFileException - if the operation could not be created.

createGetParentOperation

public au.com.prunge.jgenfile.GetParentOperation createGetParentOperation()
                                                                   throws JGenFileException
Creates an operation that will retrieve the parent of this item.

Throws:
JGenFileException - if the operation could not be created.

createCanGetParentOperation

public au.com.prunge.jgenfile.CanGetParentOperation createCanGetParentOperation()
                                                                         throws JGenFileException
Creates an operation that will test whether the parent of this item can be acquired.

Throws:
JGenFileException - if the operation could not be created.

createSetParentOperation

public au.com.prunge.jgenfile.SetParentOperation createSetParentOperation(au.com.prunge.jgenfile.Directory parent)
                                                                   throws JGenFileException
Creates an operation that will set the parent of (i.e. move) this item.

Parameters:
parent - the new parent to attempt to set with the operation.
Throws:
JGenFileException - if the operation could not be created.

createCanSetParentOperation

public au.com.prunge.jgenfile.CanSetParentOperation createCanSetParentOperation()
                                                                         throws JGenFileException
Creates an operation that tests whether the parent of this item can be changed.

Throws:
JGenFileException - if the operation could not be created.

createDeleteItemOperation

public au.com.prunge.jgenfile.DeleteItemOperation createDeleteItemOperation()
                                                                     throws JGenFileException
Creates an operation that will delete this item. If this item is a directory, any files or directories contained in this directory will also be deleted.

Throws:
JGenFileException - if the operation could not be created.

createCanDeleteOperation

public au.com.prunge.jgenfile.CanDeleteItemOperation createCanDeleteOperation()
                                                                       throws JGenFileException
Creates an operation that tests whether this item can be deleted.

Throws:
JGenFileException - if the operation could not be created.

createGetMetadataOperation

public au.com.prunge.jgenfile.GetMetadataOperation createGetMetadataOperation(Set metadataKeySet)
                                                                       throws JGenFileException,
                                                                              NullPointerException
Creates an operation that acquires the specified metadata.

Parameters:
metadataKeySet - a set of MetadataKey objects.
Throws:
JGenFileException - if the operation could not be created.
NullPointerException - if metadataKeySet is null.
See Also:
MetadataKey

createGetAllMetadataOperation

public au.com.prunge.jgenfile.GetMetadataOperation createGetAllMetadataOperation()
                                                                          throws JGenFileException
Creates an operation that acquires all available metadata for this item.

Throws:
JGenFileException - if the operation could not be created.

createGetMetadataKeysOperation

public au.com.prunge.jgenfile.GetAllMetadataKeysOperation createGetMetadataKeysOperation()
                                                                                  throws JGenFileException
Creates an operation that gets all the keys for the metadata of this item. This operation is usually less expensive than using the get all metadata operation.

An element of metadata may be either readable, writable or both. If a key exists in the set returned by this operation, the corresponding element of metadata is either readable, writable or both.

Throws:
JGenFileException - if the operation could not be created.

createCanGetMetadataOperation

public au.com.prunge.jgenfile.CanGetMetadataOperation createCanGetMetadataOperation(Set metadataKeySet)
                                                                             throws JGenFileException,
                                                                                    NullPointerException
Creates an operation that tests whether the specified metadata is accessible for this item.

Parameters:
metadataKeySet - a set of MetadataKey objects representing the elements of metadata to test for.
Throws:
JGenFileException - if the operation could not be created.
NullPointerException - if metadataKeySet is null.
See Also:
MetadataKey

createSetMetadataOperation

public au.com.prunge.jgenfile.SetMetadataOperation createSetMetadataOperation(Map metadataMap)
                                                                       throws JGenFileException,
                                                                              NullPointerException
Creates an operation that sets the specified metadata for this item.

The map's keys should consist of MetadataKey objects, the values should be appropriate for each key.

Parameters:
metadataMap - a map of MetadataKeys to values.
Throws:
JGenFileException - if the operation could not be created.
NullPointerException - if metadataMap is null.
See Also:
MetadataKey

createCanSetMetadataOperation

public au.com.prunge.jgenfile.CanSetMetadataOperation createCanSetMetadataOperation(Set metadataKeySet)
                                                                             throws JGenFileException,
                                                                                    NullPointerException
Creates an operation that tests whether the specified metadata can be set for this item.

Parameters:
metadataKeySet - a set of MetadataKey objects representing the elements of metadata to test for.
Throws:
JGenFileException - if the operation could not be created.
NullPointerException - if metadataKeySet is null.
See Also:
MetadataKey

createCopyOperation

public au.com.prunge.jgenfile.CopyItemOperation createCopyOperation(au.com.prunge.jgenfile.Directory destination)
                                                             throws JGenFileException
Creates an operation that copies this item to the specified destination directory.

Parameters:
destination - the destination directory.
Throws:
JGenFileException - if the operation could not be created.

createCopyOperation

public au.com.prunge.jgenfile.CopyItemOperation createCopyOperation(au.com.prunge.jgenfile.Directory destination,
                                                                    String newName)
                                                             throws JGenFileException
Creates an operation that copies this item to the specified destination directory giving the copied item a name of newName.

Parameters:
destination - the destination directory.
newName - the name to give the copied item.
Throws:
JGenFileException - if the operation could not be created.

createCanCopyItemOperation

public au.com.prunge.jgenfile.CanCopyItemOperation createCanCopyItemOperation()
                                                                       throws JGenFileException
Creates an operation that tests whether this item can be copied.

Throws:
JGenFileException - if the operation could not be created.

createCanCopyItemToDestinationOperation

public au.com.prunge.jgenfile.CanCopyItemToDestinationOperation createCanCopyItemToDestinationOperation(au.com.prunge.jgenfile.Directory destination)
                                                                                                 throws JGenFileException
Creates an operation that tests whether this item can be copied into the specified directory keeping its current name.

Parameters:
destination - the destination directory.
Throws:
JGenFileException - if the operation could not be created.

createCanCopyItemToDestinationOperation

public au.com.prunge.jgenfile.CanCopyItemToDestinationOperation createCanCopyItemToDestinationOperation(au.com.prunge.jgenfile.Directory destination,
                                                                                                        String newName)
                                                                                                 throws JGenFileException
Creates an operation that tests whether this item can be copied into the specified directory using the specified name.

Parameters:
destination - the destination directory.
newName - the name the copied item would have.
Throws:
JGenFileException - if the operation could not be created.

createGetAbsolutePathOperation

public au.com.prunge.jgenfile.GetAbsolutePathOperation createGetAbsolutePathOperation()
                                                                               throws JGenFileException
Creates an operation that gets the absolute path of this item.

Throws:
JGenFileException - if the operation could not be created.

createCanGetAbsolutePathOperation

public au.com.prunge.jgenfile.CanGetAbsolutePathOperation createCanGetAbsolutePathOperation()
                                                                                     throws JGenFileException
Creates an operation that tests whether the absolute path of this item can be acquired.

Throws:
JGenFileException - if the operation could not be created.

createGetRelativePathOperation

public au.com.prunge.jgenfile.GetRelativePathOperation createGetRelativePathOperation(au.com.prunge.jgenfile.Directory toAncestor)
                                                                               throws JGenFileException
Creates an operation that gets the relative path of this item up to and including toAncestor.

Parameters:
toAncestor - the ancestor to get the relative path up to. The path will start from this item and go up through each parent of this item until toAncestor is hit. toAncestor will be the most distant ancestor included in the path.
Throws:
JGenFileException - if the operation could not be created.
NullPointerException - if toAncestor is null.

createCanGetRelativePathOperation

public au.com.prunge.jgenfile.CanGetRelativePathOperation createCanGetRelativePathOperation(au.com.prunge.jgenfile.Directory toAncestor)
                                                                                     throws JGenFileException
Creates an operation that tests whether the relative path of this item up to and including toAncestor can be acquired.

Parameters:
toAncestor - the ancestor to get the relative path up to. The path will start from this item and go up through each parent of this item until toAncestor is hit.
Throws:
JGenFileException - if the operation could not be created.
NullPointerException - if toAncestor is null.