public class PropertyPack.DirCluster extends PropertyPack.Cluster
|Constructor and Description|
Construct a cluster that refers to a file and its locale/extension variants.
Construct a DirCluster that reads from a directory those property files that have a given stem.
Construct a cluster for a directory and optional file stem.
|Modifier and Type||Method and Description|
Return an open InputStream ready to read the contents of the object.
addPropNodes, countPropNodes, equals, forEachProperty, forEachPropNode, getURL, hashCode
public DirCluster(java.lang.String fnm)
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)
Filedenoting 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
relName- slash-separated relative path to the file within this Cluster's location.
FileNotFoundException- If file cannot be found
IOException- if an error occurs.