public abstract class AbstractSource extends java.lang.Object implements Source
| Modifier and Type | Field and Description |
|---|---|
private long |
m_contentLength |
private boolean |
m_gotInfos |
private long |
m_lastModificationDate |
private java.lang.String |
m_scheme |
private java.lang.String |
m_systemId |
| Constructor and Description |
|---|
AbstractSource() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkInfos()
Call
getInfos() if it hasn't already been called since the last
call to refresh(). |
long |
getContentLength()
Return the content length of the content or -1 if the length is
unknown
|
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. |
long |
getLastModified()
Get the last modification date of the source or 0 if it
is not possible to determine the date.
|
java.lang.String |
getMimeType()
The mime-type of the content described by this object.
|
java.lang.String |
getScheme()
Return the protocol identifier.
|
java.lang.String |
getURI()
Return the unique identifer for this source
|
SourceValidity |
getValidity()
Get the Validity object.
|
void |
refresh()
Refresh this object and update the last modified date
and content length.
|
protected void |
setContentLength(long contentLength)
Sets the contentLength.
|
protected void |
setLastModified(long lastModificationDate)
Sets the lastModificationDate.
|
protected void |
setScheme(java.lang.String scheme)
Sets the scheme.
|
protected void |
setSystemId(java.lang.String systemId)
Sets the systemId.
|
private boolean m_gotInfos
private long m_lastModificationDate
private long m_contentLength
private java.lang.String m_systemId
private java.lang.String m_scheme
protected void getInfos()
protected void checkInfos()
getInfos() if it hasn't already been called since the last
call to refresh().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 SourceInputStream 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 java.lang.String getURI()
public java.lang.String getScheme()
public SourceValidity getValidity()
null is returned.getValidity in interface Sourcenull.public void refresh()
public java.lang.String getMimeType()
getMimeType in interface Sourcenull.public long getContentLength()
getContentLength in interface Sourcepublic long getLastModified()
getLastModified in interface Source0.protected void setContentLength(long contentLength)
contentLength - The contentLength to setprotected void setLastModified(long lastModificationDate)
lastModificationDate - The lastModificationDate to setprotected void setScheme(java.lang.String scheme)
scheme - The scheme to setprotected void setSystemId(java.lang.String systemId)
systemId - The systemId to set