public class BundleManager
extends java.lang.Object
Bundle| Constructor and Description |
|---|
BundleManager()
Bundle manager constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Bundle |
addBundle(Bundle bundle,
java.lang.String ID)
Adds a Bundle to the managed collection of resource files.
|
int |
calculateResources(java.lang.String key)
Counts the number of resource occurences in all the managed Bundles.
|
BundleManager |
cloneThis()
Creates a shallow copy of this BundleManager.
|
Bundle |
getBundle(java.lang.String ID)
Returns a Bundle given it's symbolic ID.
|
java.lang.String |
getResource(java.lang.String key)
Searches for a resource in all the managed Bundles.
|
java.lang.String |
getResource(java.lang.String bundleID,
java.lang.String key)
Returns resource from ID bundle.
|
Bundle |
load()
Loads resources from simple text file pointed by jemmy.resources system property.
|
Bundle |
loadBundleFromFile(java.lang.String fileName,
java.lang.String ID)
Create a new Bundle, load resources from a simple text file,
and add the bundle.
|
Bundle |
loadBundleFromJar(java.lang.String fileName,
java.lang.String entryName,
java.lang.String ID)
Loads resources from file in jar archive into new Bundle object and adds it.
|
Bundle |
loadBundleFromResource(java.lang.ClassLoader cl,
java.lang.String resource,
java.lang.String ID) |
Bundle |
loadBundleFromStream(java.io.InputStream stream,
java.lang.String ID) |
Bundle |
loadBundleFromZip(java.lang.String fileName,
java.lang.String entryName,
java.lang.String ID)
Loads resources from file in zip archive into new Bundle object and adds it.
|
void |
print(java.io.PrintStream stream)
Prints bundles contents.
|
void |
print(java.io.PrintWriter writer)
Prints bundles contents.
|
Bundle |
removeBundle(java.lang.String ID)
Removes a Bundle from the managed collection of resource files.
|
public Bundle addBundle(Bundle bundle, java.lang.String ID)
bundle - Bundle objectID - Symbolic bundle idBundlepublic Bundle removeBundle(java.lang.String ID)
ID - Symbolic bundle idpublic Bundle getBundle(java.lang.String ID)
ID - Symbolic bundle IDpublic Bundle loadBundleFromFile(java.lang.String fileName, java.lang.String ID) throws java.io.IOException, java.io.FileNotFoundException
BundleManager.fileName - Name of a file to load resources from.ID - Symbolic bundle ID used to identify the new bundle used
to manage the resources from the file.java.io.IOExceptionjava.io.FileNotFoundExceptionpublic Bundle loadBundleFromStream(java.io.InputStream stream, java.lang.String ID) throws java.io.IOException, java.io.FileNotFoundException
java.io.IOExceptionjava.io.FileNotFoundExceptionpublic Bundle loadBundleFromResource(java.lang.ClassLoader cl, java.lang.String resource, java.lang.String ID) throws java.io.IOException, java.io.FileNotFoundException
java.io.IOExceptionjava.io.FileNotFoundExceptionpublic Bundle load() throws java.io.IOException, java.io.FileNotFoundException
java.io.IOExceptionjava.io.FileNotFoundExceptionpublic Bundle loadBundleFromJar(java.lang.String fileName, java.lang.String entryName, java.lang.String ID) throws java.io.IOException, java.io.FileNotFoundException
fileName - Name of jar file.entryName - ?enryName? Name of file to load resources from.ID - Symbolic bundle idjava.io.IOExceptionjava.io.FileNotFoundExceptionpublic Bundle loadBundleFromZip(java.lang.String fileName, java.lang.String entryName, java.lang.String ID) throws java.io.IOException, java.io.FileNotFoundException, java.util.zip.ZipException
fileName - Name of jar file.entryName - ?enryName? Name of file to load resources from.ID - Symbolic bundle idjava.util.zip.ZipExceptionjava.io.IOExceptionjava.io.FileNotFoundExceptionpublic void print(java.io.PrintWriter writer)
writer - Writer to print data in.public void print(java.io.PrintStream stream)
stream - Stream to print data in.public java.lang.String getResource(java.lang.String bundleID,
java.lang.String key)
bundleID - Bundle ID.key - Resource key.public java.lang.String getResource(java.lang.String key)
key - Resource key.public int calculateResources(java.lang.String key)
key - Resource keypublic BundleManager cloneThis()