public class PropertyPack.DirCluster extends PropertyPack.Cluster
{stemName}{variant}{ext}
where
packStem
propNodeList
Constructor and Description |
---|
DirCluster(File f)
Construct a cluster that refers to a file and its
locale/extension variants.
|
DirCluster(File d,
java.lang.String stem)
Construct a DirCluster that reads from a directory
those property files that have a given stem.
|
DirCluster(java.lang.String fnm)
Construct a cluster for a directory and optional
file stem.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
openFile(java.lang.String relName)
Return an open InputStream ready to read the contents of the object.
|
java.lang.String |
toString() |
addPropNodes, countPropNodes, equals, forEachProperty, forEachPropNode, getURL, hashCode
public DirCluster(java.lang.String fnm)
packStem
'.fnm
- name of a directory or a file within
a directory. The directory must be absolute and
readable. If fnm refers to a directory, the stem is
that of the PropertyPack; otherwise the stem
is fnm stripped of directories, locale variants, and
extension.public DirCluster(File f)
packStem
.f
- A File
denoting a directory
and an optional file within it. The directory must
be absolute and refer to a readable directory.
If there is no file, the stem is taken to be packStem;
otherwise the cluster's stem is the file name
stripped of its extension and
any locale suffix(es) beginning with '_'.public DirCluster(File d, java.lang.String stem)
d
- the root directory of the Cluster.
It must be absolute and readable.stem
- prefix for properties file names.
It will be stripped of a file extension and any suffixes
beginning with '_'.public InputStream openFile(java.lang.String relName) throws IOException
openFile
in class PropertyPack.Cluster
relName
- slash-separated relative path to the file
within this Cluster's location.FileNotFoundException
- If file cannot be foundIOException
- if an error occurs.public java.lang.String toString()
toString
in class PropertyPack.Cluster