org.exist.source
Class URLSource
java.lang.Object
org.exist.source.AbstractSource
org.exist.source.URLSource
- All Implemented Interfaces:
- Source
- Direct Known Subclasses:
- ClassLoaderSource
public class URLSource
- extends AbstractSource
A source implementation reading from an URL.
- Author:
- wolf
Constructor Summary |
URLSource(java.net.URL url)
|
Method Summary |
java.lang.String |
getContent()
|
java.lang.Object |
getKey()
Returns a unique key to identify the source, usually
an URI. |
java.io.Reader |
getReader()
Returns a Reader to read the contents
of the source. |
java.net.URL |
getURL()
|
int |
isValid(DBBroker broker)
Is this source object still valid?
Returns Source.UNKNOWN if the validity of
the source cannot be determined. |
int |
isValid(Source other)
Checks if the source object is still valid
by comparing it to another version of the
same source. |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, toString, wait, wait, wait |
URLSource
public URLSource(java.net.URL url)
getURL
public java.net.URL getURL()
getKey
public java.lang.Object getKey()
- Description copied from interface:
Source
- Returns a unique key to identify the source, usually
an URI.
isValid
public int isValid(DBBroker broker)
- Description copied from interface:
Source
- Is this source object still valid?
Returns
Source.UNKNOWN
if the validity of
the source cannot be determined.
The DBBroker
parameter is required by
some implementations as they have to read
resources from the database.
isValid
public int isValid(Source other)
- Description copied from interface:
Source
- Checks if the source object is still valid
by comparing it to another version of the
same source. It depends on the concrete
implementation how the sources are compared.
Use this method if
Source.isValid(DBBroker)
return Source.UNKNOWN
.
getReader
public java.io.Reader getReader()
throws java.io.IOException
- Description copied from interface:
Source
- Returns a
Reader
to read the contents
of the source.
- Throws:
java.io.IOException
getContent
public java.lang.String getContent()
throws java.io.IOException
- Throws:
java.io.IOException
Copyright (C) Wolfgang Meier. All rights reserved.