public class DocumentConversion extends WatsonService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VERSION_DATE_2015_12_01
The Constant VERSION_DATE_2015_12_01.
|
defaultHeaders, MESSAGE_CODE, MESSAGE_ERROR, skipAuthentication, VERSION
Constructor and Description |
---|
DocumentConversion(java.lang.String versionDate)
Instantiates a new document conversion.
|
DocumentConversion(java.lang.String versionDate,
java.lang.String username,
java.lang.String password)
Instantiates a new document conversion by username and password.
|
Modifier and Type | Method and Description |
---|---|
ServiceCall<Answers> |
convertDocumentToAnswer(java.io.File document)
Converts a document to Answer Units.
|
ServiceCall<Answers> |
convertDocumentToAnswer(java.io.File document,
java.lang.String mediaType)
Converts a document to Answer Units.
|
ServiceCall<Answers> |
convertDocumentToAnswer(java.io.File document,
java.lang.String mediaType,
com.google.gson.JsonObject customConfig)
Converts a document to Answer Units using a custom configuration.
|
ServiceCall<java.lang.String> |
convertDocumentToHTML(java.io.File document)
Converts a document to HTML.
|
ServiceCall<java.lang.String> |
convertDocumentToHTML(java.io.File document,
java.lang.String mediaType)
Converts a document to HTML.
|
ServiceCall<java.lang.String> |
convertDocumentToHTML(java.io.File document,
java.lang.String mediaType,
com.google.gson.JsonObject customConfig)
Converts a document to HTML using a custom configuration.
|
ServiceCall<java.lang.String> |
convertDocumentToText(java.io.File document)
Converts a document to Text.
|
ServiceCall<java.lang.String> |
convertDocumentToText(java.io.File document,
java.lang.String mediaType)
Converts a document to Text.
|
ServiceCall<java.lang.String> |
convertDocumentToText(java.io.File document,
java.lang.String mediaType,
com.google.gson.JsonObject customConfig)
Converts a document to Text using a custom configuration.
|
ServiceCall<java.lang.String> |
indexDocument(IndexDocumentOptions indexDocumentOptions)
Converts and indexes the document and metadata provided.
|
configureHttpClient, createServiceCall, getApiKey, getEndPoint, getName, getToken, processServiceCall, setApiKey, setAuthentication, setDefaultHeaders, setDefaultHeaders, setEndPoint, setSkipAuthentication, setUsernameAndPassword, toString
public static final java.lang.String VERSION_DATE_2015_12_01
public DocumentConversion(java.lang.String versionDate)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value will keep your API
calls from failing when the service introduces breaking changes.public DocumentConversion(java.lang.String versionDate, java.lang.String username, java.lang.String password)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value will keep your API
calls from failing when the service introduces breaking changes.username
- the usernamepassword
- the passwordpublic ServiceCall<Answers> convertDocumentToAnswer(java.io.File document)
convertDocumentToAnswer(File, String)
if you want to specify the media typedocument
- the documentAnswers
public ServiceCall<Answers> convertDocumentToAnswer(java.io.File document, java.lang.String mediaType)
document
- the documentmediaType
- the document media type. It will use the file extension if not providedAnswers
HttpMediaType for available media types
public ServiceCall<Answers> convertDocumentToAnswer(java.io.File document, java.lang.String mediaType, com.google.gson.JsonObject customConfig)
document
- the documentmediaType
- the document media type. It will use the file extension if not provided.customConfig
- the configuration parameters to customize the conversionString
public ServiceCall<java.lang.String> convertDocumentToHTML(java.io.File document)
convertDocumentToHTML(File, String)
if you want to specify the media type.document
- the documentString
public ServiceCall<java.lang.String> convertDocumentToHTML(java.io.File document, java.lang.String mediaType)
document
- the documentmediaType
- the document media type. It will use the file extension if not provided.String
for available media types
public ServiceCall<java.lang.String> convertDocumentToHTML(java.io.File document, java.lang.String mediaType, com.google.gson.JsonObject customConfig)
document
- the documentmediaType
- the document media type. It will use the file extension if not provided.customConfig
- the configuration parameters to customize the conversionString
public ServiceCall<java.lang.String> convertDocumentToText(java.io.File document)
convertDocumentToText(File, String)
if you want to specify the media type.document
- the documentString
public ServiceCall<java.lang.String> convertDocumentToText(java.io.File document, java.lang.String mediaType)
document
- the documentmediaType
- the document media type. It will use the file extension if not provided.String
for available media types
public ServiceCall<java.lang.String> convertDocumentToText(java.io.File document, java.lang.String mediaType, com.google.gson.JsonObject customConfig)
document
- the documentmediaType
- the document media type. It will use the file extension if not provided.customConfig
- the configuration parameters to customize the conversionString
public ServiceCall<java.lang.String> indexDocument(IndexDocumentOptions indexDocumentOptions)
indexDocumentOptions
- Specifies the options for indexing the documentString