public class FolderManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
log
Used for logging.
|
Constructor and Description |
---|
FolderManager() |
Modifier and Type | Method and Description |
---|---|
static void |
addFolder(Folder folder)
Adds a folder to the set.
|
static Folder |
addNewFolder()
Adds a new folder.
|
static void |
deleteFolder(Folder folder)
Deletes a folder, including deleting it from the database.
|
static void |
dumpToLog()
Dumps all of the folders to the log.
|
static Folder |
getFolderByID(int ID)
Gets a
Folder by its database ID. |
static Folder |
getFolderByName(java.lang.String name)
Gets a
Folder by its name. |
static Folder |
getFolderBySequence(int sequence)
Gets a
Folder by sequence. |
static java.util.Iterator |
getFoldersIterator()
Provides an
Iterator to cycle over the folders. |
static int |
getNumFoldersWithName(java.lang.String name)
Gets the number of folders carrying the given name.
|
static int |
getNumTopLevelFolders()
Gets the total number of top-level folders.
|
static int |
getSequenceForFolder(Folder folder)
Gets the sequence for the given folder.
|
static void |
removeFolder(Folder folder)
Removes a folder from the manager.
|
static void |
save()
Saves all folders.
|
public static java.util.Iterator getFoldersIterator()
Iterator
to cycle over the folders.Iterator
.public static Folder getFolderBySequence(int sequence)
Folder
by sequence.sequence
- The sequence.Folder
, if one exists at the given
sequence; null, otherwise.public static Folder getFolderByID(int ID)
Folder
by its database ID.ID
- The ID of the folder.Folder
, if one exists for the given
ID; null, otherwise.public static Folder getFolderByName(java.lang.String name)
Folder
by its name.name
- The name of the folder.Folder
, if one exists for the given
name; null, otherwise.public static int getNumFoldersWithName(java.lang.String name)
name
- The name of the folder.public static int getSequenceForFolder(Folder folder)
folder
- The Folder
.public static int getNumTopLevelFolders()
public static void addFolder(Folder folder)
folder
- A Folder
.public static Folder addNewFolder()
public static void removeFolder(Folder folder)
folder
- The Folder
to be deleted.public static void deleteFolder(Folder folder)
folder
- The Folder
to be deleted.public static void save()
public static void dumpToLog()