|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.excalibur.source.impl.AbstractSource
org.apache.excalibur.source.impl.URLSource
public class URLSource
Description of a source which is described by an URL.
Field Summary | |
---|---|
(package private) org.apache.avalon.framework.parameters.Parameters |
avalonParameters
|
private static java.lang.String |
CONNECT_TIMEOUT
|
(package private) int |
connectTimeout
|
protected long |
m_cachedLastModificationDate
|
protected SourceValidity |
m_cachedValidity
the prev returned SourceValidity |
protected java.net.URLConnection |
m_connection
The connection for a real URL |
protected java.lang.String |
m_encoding
The encoding of the SourceParameters |
protected boolean |
m_exists
Does this source exist ? |
protected boolean |
m_isPost
Is this a post? |
protected java.lang.String |
m_mimeType
The content type (if known) |
protected SourceParameters |
m_parameters
The SourceParameters used for a post |
protected java.net.URL |
m_url
The URL of the source |
private static java.lang.String |
READ_TIMEOUT
|
(package private) int |
readTimeout
|
Constructor Summary | |
---|---|
URLSource()
Constructor |
Method Summary | |
---|---|
boolean |
exists()
Does this source exist ? |
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. |
protected java.lang.String |
getUserInfo()
The decoded userinfo for this source. |
SourceValidity |
getValidity()
Get the Validity object. |
void |
init(java.net.URL url,
java.util.Map parameters)
Initialize a new object from a URL . |
void |
parameterize(org.apache.avalon.framework.parameters.Parameters par)
|
void |
refresh()
Refresh this object and update the last modified date and content length. |
Methods inherited from class org.apache.excalibur.source.impl.AbstractSource |
---|
checkInfos, getContentLength, getLastModified, getScheme, getURI, setContentLength, setLastModified, setScheme, setSystemId |
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 |
---|
getContentLength, getLastModified, getScheme, getURI |
Field Detail |
---|
private static final java.lang.String CONNECT_TIMEOUT
private static final java.lang.String READ_TIMEOUT
int connectTimeout
int readTimeout
protected java.net.URL m_url
protected java.net.URLConnection m_connection
protected SourceParameters m_parameters
SourceParameters
used for a post
protected java.lang.String m_encoding
SourceParameters
protected boolean m_isPost
protected boolean m_exists
protected SourceValidity m_cachedValidity
protected long m_cachedLastModificationDate
protected java.lang.String m_mimeType
org.apache.avalon.framework.parameters.Parameters avalonParameters
Constructor Detail |
---|
public URLSource()
Method Detail |
---|
public void init(java.net.URL url, java.util.Map parameters) throws java.io.IOException
URL
.
parameters
- This is optional
java.io.IOException
public void parameterize(org.apache.avalon.framework.parameters.Parameters par)
protected void getInfos()
getInfos
in class AbstractSource
public boolean exists()
exists
in interface Source
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
getInputStream
in class AbstractSource
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 SourceValidity getValidity()
null
is returned.
getValidity
in interface Source
getValidity
in class AbstractSource
null
.public void refresh()
refresh
in interface Source
refresh
in class AbstractSource
public java.lang.String getMimeType()
getMimeType
in interface Source
getMimeType
in class AbstractSource
null
.protected java.lang.String getUserInfo()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |