public class PropertyPack.JarCluster extends PropertyPack.Cluster
propNodeList
Constructor and Description |
---|
JarCluster(java.lang.Object obj,
java.lang.String stemPath)
Construct a JarCluster for a particular object and stem.
|
JarCluster(java.lang.Object obj,
java.lang.String stem,
java.lang.ClassLoader load)
Construct a JarCluster with the jar of an object,
a stem path, and a classloader.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
openFile(java.lang.String relName) |
java.lang.String |
toString() |
addPropNodes, countPropNodes, equals, forEachProperty, forEachPropNode, getURL, hashCode
public JarCluster(java.lang.Object obj, java.lang.String stemPath)
obj
- Indicates Class to use for finding jar
and choosing a C;lassLoader.stemPath
- Location within the jar of the
property files; a slash-separated list of parent directories.
The last element is the name of the properties file,
from which locale variants and the extension are stripped.public JarCluster(java.lang.Object obj, java.lang.String stem, java.lang.ClassLoader load)
obj
- Indicates an object in the same jar file
as the required properties file. If obj is
itself a Class object, the jar file will be that
of the class's members. This value contributes only
to the URL imputed for objects of this Cluster.
Otherwise the cluster's jar file is implicit in
the ClassLoader.stem
- Path location of the
properties file within the jar. It is a slash-separated
sequence of the elements of the binary name of the
properties file. No leading slash.
Extension and locale suffixes (_xx) are deleted.
The stem value must also indicate the directory
within the jar. The directory is derived thus:
packName
is appended.packName
.load
- A ClassLoader. Usually that of the first
parameter (as provided by the other constructor).public InputStream openFile(java.lang.String relName)
openFile
in class PropertyPack.Cluster
relName
- location of the desired file within the cluster.
Usually this method is called from
createPropNode
; in this case relName
is a locale suffix and an extension. To open a sibling
of the properties file, relName
may be
/../siblingname.ext
.
The client MUST close the stream. Accordingly, an IOException
may thrown. This is intended to encourage calling this method
from within the parenthesized resouces clause
of a try
statement.
public java.lang.String toString()
toString
in class PropertyPack.Cluster