|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.common.util.DirectoryItems
public class DirectoryItems
This class represents a collection of files present within a directory hierarchy, categorized according to their directories. This collection will include all files inside of JAR and ZIP files that are located in the directory hierarchy. Created on January 17, 2004
| Constructor Summary | |
|---|---|
DirectoryItems(java.io.File rootDir,
java.lang.String categoryName,
ItemFileFactory itemFactory)
Create a categorized collection of all files beneth the given directory. |
|
| Method Summary | |
|---|---|
java.util.Iterator<java.lang.String> |
getCategoryNames()
Get the names of all the categories. |
java.lang.Object |
getItem(java.lang.String categoryName,
java.lang.String itemName)
Get the indicated item from the correct catagory. |
java.util.Iterator<java.lang.String> |
getItemNames(java.lang.String categoryName)
Get the names of all the items in one of the categories. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DirectoryItems(java.io.File rootDir,
java.lang.String categoryName,
ItemFileFactory itemFactory)
throws java.lang.IllegalArgumentException
rootDir - - the File object for the root directory of
the image files. All files in this root, or in any sub-
directory of this root will be included in this collection.
This value must not be null and it must be a
directory.categoryName - - the String root category name for
this collection. All sub-categories will include this name.
This value may be null (it will be replaced).itemFactory - - the ItemFileFactory that will create
ItemFiles for the contents of the directory.
This value must not be null.
IllegalArgumentException - if rootDir
is null or if it is not a directory, or if a
null is passed for itemFactory.
java.lang.IllegalArgumentException| Method Detail |
|---|
public java.util.Iterator<java.lang.String> getCategoryNames()
getCategoryNames in interface CategorizedEnumeration of String names.
This value will not be null, but it may be empty.public java.util.Iterator<java.lang.String> getItemNames(java.lang.String categoryName)
getItemNames in interface CategorizedcategoryName - - the String name of the category
whose item names are required.
Enumeration of String names.
This value will not be null, but it may be empty.
public java.lang.Object getItem(java.lang.String categoryName,
java.lang.String itemName)
throws java.lang.Exception
getItem in interface CategorizedcategoryName - - the String name of the category
whose item names are required. This value may be
null.itemName - - the String name of the indicated item.
Object in the given category with the given
name. This value may be null.
- Throws:
Exception - if there's any error getting the item.
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||