com.languagecomputer.api
Class DocumentWebServiceImpl
java.lang.Object
com.languagecomputer.api.BaseWebServiceImpl
com.languagecomputer.api.DocumentWebServiceImpl
- All Implemented Interfaces:
- BaseWebService, DocumentWebService
public class DocumentWebServiceImpl
- extends BaseWebServiceImpl
- implements DocumentWebService
Implementation of DocumentWebService
.
- Since:
- 1.0
- Author:
- Toby Jungen
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DocumentWebServiceImpl
public DocumentWebServiceImpl(SessionManager sessionManager)
- Creates a new
DocumentWebServiceImpl
using the given
sessionManager.
- Parameters:
sessionManager
- The SessionManager
to use for Session
control.
process
public String process(String sessionID,
String url,
String type,
String format)
throws Exception
- Processes a document at a specific
URL
by downloading it and
ingesting it. Strips extraneous markup and normalizes the text.
- Specified by:
process
in interface DocumentWebService
- Parameters:
sessionID
- The unique identifier String
for the session
for this operation.url
- The URL
of the document to be processed.type
- The type of document specified in the url. Defaults
to AUTO
format
- The format in which the document should be returned. Defaults
to XML
.
- Returns:
- The processed document in the format requested.
- Throws:
Exception
- If there was an error processing the document.
processContent
public String processContent(String sessionID,
byte[] content,
String type,
String format)
throws Exception
- Processes a document with the given content. Strips extraneous
markup and normalizes the text.
- Specified by:
processContent
in interface DocumentWebService
- Parameters:
sessionID
- The unique identifier String
for the session
for this operation.content
- The document content to process.type
- The type of document specified in the url. Defaults
to AUTO
format
- The format in which the document should be returned. Defaults
to XML
.
- Returns:
- The processed document in the format requested.
- Throws:
Exception
- If there was an error processing the document.
Copyright © 2009. All Rights Reserved.