public class URLDataSource extends DataSource<Reader>
A data source implementation which can be used to read character files using HTTP.
Refer to http://wiki.apache.org/solr/DataImportHandler for more details.
This API is experimental and may change in the future.Modifier and Type | Field and Description |
---|---|
static String |
BASE_URL |
static int |
CONNECTION_TIMEOUT |
static String |
CONNECTION_TIMEOUT_FIELD_NAME |
static String |
ENCODING |
static int |
READ_TIMEOUT |
static String |
READ_TIMEOUT_FIELD_NAME |
static String |
UTF_8 |
Constructor and Description |
---|
URLDataSource() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Cleans up resources of this DataSource after use.
|
String |
getBaseUrl() |
Reader |
getData(String query)
Get records for the given query.The return type depends on the
implementation .
|
void |
init(Context context,
Properties initProps)
Initializes the DataSource with the
Context and
initialization properties. |
public static final String ENCODING
public static final String BASE_URL
public static final String UTF_8
public static final String CONNECTION_TIMEOUT_FIELD_NAME
public static final String READ_TIMEOUT_FIELD_NAME
public static final int CONNECTION_TIMEOUT
public static final int READ_TIMEOUT
public void init(Context context, Properties initProps)
DataSource
Context
and
initialization properties.
This is invoked by the DataImporter
after creating an
instance of this class.init
in class DataSource<Reader>
public Reader getData(String query)
DataSource
getData
in class DataSource<Reader>
query
- The query string. It can be a SQL for JdbcDataSource or a URL
for HttpDataSource or a file location for FileDataSource or a custom
format for your own custom DataSource.public void close()
DataSource
close
in class DataSource<Reader>
public String getBaseUrl()