public class PropertyPack.URLCluster extends PropertyPack.Cluster
propNodeList
Constructor and Description |
---|
URLCluster(java.net.URL u)
Construct a Cluster that reads files relative to an URL.
|
URLCluster(java.net.URL location,
java.lang.String stem)
Construct a Cluster that looks in a given URL under a given
stem name.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
openFile(java.lang.String relName) |
java.lang.String |
toString() |
addPropNodes, countPropNodes, equals, forEachProperty, forEachPropNode, getURL, hashCode
public URLCluster(java.net.URL u)
u
- The URL to look under. Any fragment
(#xxxx) is discarded. A file extension is deleted.
The resulting name is prepended to requests.public URLCluster(java.net.URL location, java.lang.String stem)
location
- root of the URL. If there is no trailing slash,
one is addedstem
- the prefix for properties files names.
Any leading slash is deleted.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