Package gnu.text
Class ResourceStreamHandler
java.lang.Object
java.net.URLStreamHandler
gnu.text.ResourceStreamHandler
Handler for
"class-resource:"
URLs.
These are "indirect URLs" implemented using ClassLoader.getResource().
Their syntax is: either:
class-resource:/PACKAGE/CLASS
or
class-resource:/CLASS
or
class-resource:/PACKAGE/RESOURCE
or
class-resource:/RESOURCE
.
The former two are "base URLs" which need to be resolved.
The latter two are resolved resource names.
Levels of a PACKAGE
are separated by '.'
, not '/'
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
A special URI-scheme for accessing resources relative to a ClassLoader.static final int
The length of CLASS_RESOURCE_URI_PREFIX, including ":/". -
Constructor Summary
ConstructorsConstructorDescriptionResourceStreamHandler
(Class clas) ResourceStreamHandler
(ClassLoader cloader) -
Method Summary
Methods inherited from class java.net.URLStreamHandler
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, openConnection, parseURL, sameFile, setURL, setURL, toExternalForm
-
Field Details
-
CLASS_RESOURCE_URI_PREFIX
A special URI-scheme for accessing resources relative to a ClassLoader. The resource is found using ClassLoader's getResource method. The actual ClassLoader is found using getClassLoaderForURI.- See Also:
-
CLASS_RESOURCE_URI_PREFIX_LENGTH
public static final int CLASS_RESOURCE_URI_PREFIX_LENGTHThe length of CLASS_RESOURCE_URI_PREFIX, including ":/".- See Also:
-
-
Constructor Details
-
ResourceStreamHandler
-
ResourceStreamHandler
-
-
Method Details
-
makeURL
- Throws:
MalformedURLException
-
openConnection
- Specified by:
openConnection
in classURLStreamHandler
- Throws:
IOException
-