|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.excalibur.source.impl.AbstractSource
Abstract base class for a source implementation.
Constructor Summary | |
AbstractSource()
|
Method Summary | |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.excalibur.source.Source |
exists |
Constructor Detail |
public AbstractSource()
Method Detail |
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 Source
InputStream
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()
getURI
in interface Source
public java.lang.String getScheme()
getScheme
in interface Source
public SourceValidity getValidity()
null
is returned.
getValidity
in interface Source
null
.public void refresh()
refresh
in interface Source
public java.lang.String getMimeType()
getMimeType
in interface Source
null
.public long getContentLength()
getContentLength
in interface Source
public long getLastModified()
getLastModified
in interface Source
0
.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
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |