public final class BaseXClient extends Object implements Closeable
| Modifier and Type | Class and Description |
|---|---|
class |
BaseXClient.Query
Inner class for iterative query execution.
|
| Constructor and Description |
|---|
BaseXClient(String host,
int port,
String username,
String password)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(String path,
InputStream input)
Adds a document to a database.
|
void |
close()
Closes the session.
|
void |
create(String name,
InputStream input)
Creates a database.
|
String |
execute(String command)
Executes a command and returns the result.
|
void |
execute(String command,
OutputStream output)
Executes a command and serializes the result to an output stream.
|
String |
info()
Returns command information.
|
BaseXClient.Query |
query(String query)
Creates a query object.
|
void |
replace(String path,
InputStream input)
Replaces a document in a database.
|
void |
store(String path,
InputStream input)
Stores a binary resource in a database.
|
public static final Charset UTF8
public BaseXClient(String host, int port, String username, String password) throws IOException
host - server nameport - server portusername - user namepassword - passwordIOException - Exceptionpublic void execute(String command, OutputStream output) throws IOException
command - commandoutput - output streamIOException - Exceptionpublic String execute(String command) throws IOException
command - commandIOException - Exceptionpublic BaseXClient.Query query(String query) throws IOException
query - query stringIOException - Exceptionpublic void create(String name, InputStream input) throws IOException
name - name of databaseinput - xml inputIOException - I/O exceptionpublic void add(String path, InputStream input) throws IOException
path - path to resourceinput - xml inputIOException - I/O exceptionpublic void replace(String path, InputStream input) throws IOException
path - path to resourceinput - xml inputIOException - I/O exceptionpublic void store(String path, InputStream input) throws IOException
path - path to resourceinput - xml inputIOException - I/O exceptionpublic String info()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException - ExceptionCopyright © 2017. All rights reserved.