public class LocalSession extends Session
Constructor and Description |
---|
LocalSession(Context context)
Default constructor.
|
LocalSession(Context context,
OutputStream output)
Constructor, specifying an output stream.
|
LocalSession(Context context,
String username,
String password)
Constructor, specifying login data.
|
LocalSession(Context context,
String username,
String password,
OutputStream output)
Constructor, specifying login data and an output stream.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String path,
InputStream input)
Adds a document to the opened database.
|
void |
close() |
Context |
context()
Returns the associated database context.
|
void |
create(String name,
InputStream input)
Creates a database.
|
protected void |
execute(Command command,
OutputStream output)
Executes a command and prints the result to the specified output stream.
|
protected void |
execute(String command,
OutputStream output)
Executes a command and prints the result to the specified output stream.
|
LocalQuery |
query(String query)
Returns a query object for the specified query string.
|
void |
replace(String path,
InputStream input)
Replaces a document in an open database.
|
void |
store(String path,
InputStream input)
Stores raw data in an open database.
|
execute, execute, getOutputStream, info, setOutputStream
public LocalSession(Context context)
context
- contextpublic LocalSession(Context context, OutputStream output)
context
- contextoutput
- output streampublic LocalSession(Context context, String username, String password) throws LoginException
context
- contextusername
- user namepassword
- password (plain text)LoginException
- login exceptionpublic LocalSession(Context context, String username, String password, OutputStream output) throws LoginException
context
- contextusername
- user namepassword
- password (plain text)output
- output streamLoginException
- login exceptionpublic void create(String name, InputStream input) throws BaseXException
Session
create
in class Session
name
- name of databaseinput
- xml inputBaseXException
public void add(String path, InputStream input) throws BaseXException
Session
add
in class Session
path
- target pathinput
- xml inputBaseXException
public void replace(String path, InputStream input) throws BaseXException
Session
replace
in class Session
path
- document(s) to replaceinput
- new contentBaseXException
public void store(String path, InputStream input) throws BaseXException
Session
store
in class Session
path
- target pathinput
- binary inputBaseXException
public LocalQuery query(String query)
Session
public void close()
protected void execute(String command, OutputStream output) throws BaseXException
Session
execute
in class Session
command
- command to be parsedoutput
- output streamBaseXException
protected void execute(Command command, OutputStream output) throws BaseXException
Session
execute
in class Session
command
- command to be executedoutput
- output streamBaseXException
public Context context()
Copyright © 2005–2015 BaseX Team. All rights reserved.