imageorg
Interface Folder

All Superinterfaces:
FileElement, java.io.Serializable

public interface Folder
extends FileElement

This interface extends FileElement and represents a folder on disk.

See Also:
FileElement

Method Summary
 Folder createSubFolder(java.lang.String name)
          This method creates a sub-folder inside this folder.
 java.util.Collection<FileElement> getContents()
          This method returns a Collection containing all the FileElements contained in this Folder.
 java.util.Collection<Folder> getFolders()
          This method returns a Collection containing all the sub-Folders contained in this Folder.
 java.util.Collection<Image> getImages()
          This method returns a Collection containing all the Images contained in this Folder.
 boolean isRoot()
          This method returns true if this Folder object represents the on disk root (or home) directory of the ImageOrganizer library.
 
Methods inherited from interface imageorg.FileElement
addAnnotation, copy, delete, getAnnotations, getName, move, removeAnnotation, rename
 

Method Detail

isRoot

boolean isRoot()
This method returns true if this Folder object represents the on disk root (or home) directory of the ImageOrganizer library. Otherwise, it returns false.

Returns:
true if this Folder is the root.

createSubFolder

Folder createSubFolder(java.lang.String name)
                       throws java.lang.Exception
This method creates a sub-folder inside this folder. It should create a physical folder on disk and return a Folder object representing the newly created disk folder. If the supplied folder name already exists as a sub-folder inside this folder then null should be returned.

Parameters:
name - the name of the sub-folder to create
(Precondition: name != null).
Returns:
a Folder object representing the new sub-folder or null if the Folder already exists.
Throws:
java.lang.Exception - if something goes wrong during folder creation.

getContents

java.util.Collection<FileElement> getContents()
This method returns a Collection containing all the FileElements contained in this Folder. If this Folder is empty, then the returned Collection will be empty (i.e. of size 0).

Returns:
a Collection value

getImages

java.util.Collection<Image> getImages()
This method returns a Collection containing all the Images contained in this Folder. If there are no Images in this Folder then the returned Collection will be empty (i.e. of size 0).

Returns:
a Collection value

getFolders

java.util.Collection<Folder> getFolders()
This method returns a Collection containing all the sub-Folders contained in this Folder. If there are no sub-Folders in this Folder then the returned Collection will be empty (i.e. of size 0).

Returns:
a Collection value