public final class ResourceSource extends AbstractSource implements Source
| Modifier and Type | Field and Description |
|---|---|
private java.net.URL |
m_location
Location of the resource
|
private java.lang.String |
m_mimeType |
| Constructor and Description |
|---|
ResourceSource(java.lang.String systemId) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists()
Does this source exist ?
|
protected java.lang.ClassLoader |
getClassLoader() |
protected void |
getInfos()
Get the last modification date and content length of the source.
|
java.io.InputStream |
getInputStream()
Return an
InputStream object to read from the source. |
java.lang.String |
getMimeType()
The mime-type of the content described by this object.
|
SourceValidity |
getValidity()
Returns
TimeStampValidity as resources may change in a directory-based classloader. |
checkInfos, getContentLength, getLastModified, getScheme, getURI, refresh, setContentLength, setLastModified, setScheme, setSystemIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetContentLength, getLastModified, getScheme, getURI, refreshprivate java.net.URL m_location
private java.lang.String m_mimeType
public ResourceSource(java.lang.String systemId)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionpublic boolean exists()
Sourceprotected void getInfos()
AbstractSourcegetInfos in class AbstractSourcepublic java.lang.String getMimeType()
AbstractSourcegetMimeType in interface SourcegetMimeType in class AbstractSourcenull.public java.io.InputStream getInputStream()
throws java.io.IOException,
SourceException
InputStream object to read from the source.
The returned stream must be closed by the calling code.getInputStream in interface SourcegetInputStream in class AbstractSourceInputStream to read data from (never null).SourceException - if file not found or
HTTP location does not exist.java.io.IOException - if I/O error occured.public SourceValidity getValidity()
TimeStampValidity as resources may change in a directory-based classloader.getValidity in interface SourcegetValidity in class AbstractSourcenull.protected java.lang.ClassLoader getClassLoader()