|
XCC/J 6.0-3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.marklogic.xcc.examples.ContentFetcher
public class ContentFetcher
This class fetches documents from the conentbase and writes their serialized contents to a
provided OutputStream.
Click here for the source code for this class
| Constructor Summary | |
|---|---|
ContentFetcher(URI serverUri)
Construct an instance that may be used to fetch documents. |
|
| Method Summary | |
|---|---|
static void |
main(String[] args)
Command-line main() method to fetch a document. |
void |
setRequestOptions(RequestOptions options)
Set (or clear) the RequestOptions instance to associate with submitted queries. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContentFetcher(URI serverUri)
throws XccConfigException
serverUri - A URI identifying a ContentSource, in the format expected by
ContentSourceFactory.newContentSource(java.net.URI).
XccConfigException - Thrown if a Session cannot be created. This usually indicates that the
host/port or user credentials are incorrect.| Method Detail |
|---|
public void setRequestOptions(RequestOptions options)
Set (or clear) the RequestOptions instance to associate with submitted queries.
Note: It's a good idea to set CachedResult=false. Since the data is being written straight
out to an OutputStream there is no need to buffer the document first. Streaming will
also accommodate arbitrarily large documents without running out of memory. Setting an
options value of null will use defaults, which includes cached result mode.
options - An instance of RequestOptions or null.
public static void main(String[] args)
throws Exception
args - Arg 1: A server URL as per
ContentSourceFactory.newContentSource(java.net.URI). Arg 2: A document
URI. Optional Args 3&4: "-o outputfilename"
Exception - No exceptions are handled, anything that goes wrong will spew out a stack trace
and exit.
|
XCC/J 6.0-3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com