public final class ResourceSource extends AbstractSource
Modifier and Type | Field and Description |
---|---|
private static Logger |
__LOGGER |
private URL |
_location
Location of the resource
|
private String |
_mimeType |
private String |
_path |
Constructor and Description |
---|
ResourceSource(String systemId)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
exists() |
private ClassLoader |
getClassLoader() |
protected void |
getInfos() |
InputStream |
getInputStream()
Return an
InputStream object to read from the source. |
URL |
getLocation()
Get the location of the resource
|
String |
getMimeType() |
SourceValidity |
getValidity()
Returns
NOPValidity.SHARED_INSTANCE since a resource doesn't
change. |
checkInfos, getContentLength, getLastModified, getScheme, getURI, refresh, setContentLength, setLastModified, setScheme, setSystemId
public ResourceSource(String systemId) throws MalformedURLException, SourceNotFoundException
systemId
- URI of the desired resourceMalformedURLException
- if the systemId is not like <scheme>://<path>SourceNotFoundException
- if the location can not be found in the class loaderpublic boolean exists()
protected void getInfos()
getInfos
in class AbstractSource
public String getMimeType()
getMimeType
in interface Source
getMimeType
in class AbstractSource
public InputStream getInputStream() throws IOException
InputStream
object to read from the source.getInputStream
in interface Source
getInputStream
in class AbstractSource
IOException
public SourceValidity getValidity()
NOPValidity.SHARED_INSTANCE
since a resource doesn't
change.getValidity
in interface Source
getValidity
in class AbstractSource
private ClassLoader getClassLoader()
public URL getLocation()