public class DocumentConversion extends WatsonService
Modifier and Type | Field and Description |
---|---|
static String |
VERSION_DATE_2015_12_01
The Constant VERSION_DATE_2015_12_01.
|
defaultHeaders, MESSAGE_CODE, MESSAGE_ERROR, skipAuthentication, VERSION
Constructor and Description |
---|
DocumentConversion(String versionDate)
Instantiates a new document conversion.
|
DocumentConversion(String versionDate,
String username,
String password)
Instantiates a new document conversion by username and password.
|
Modifier and Type | Method and Description |
---|---|
ServiceCall<Answers> |
convertDocumentToAnswer(File document)
Converts a document to Answer Units.
|
ServiceCall<Answers> |
convertDocumentToAnswer(File document,
String mediaType)
Converts a document to Answer Units.
|
ServiceCall<Answers> |
convertDocumentToAnswer(File document,
String mediaType,
com.google.gson.JsonObject customConfig)
Converts a document to Answer Units using a custom configuration.
|
ServiceCall<String> |
convertDocumentToHTML(File document)
Converts a document to HTML.
|
ServiceCall<String> |
convertDocumentToHTML(File document,
String mediaType)
Converts a document to HTML.
|
ServiceCall<String> |
convertDocumentToHTML(File document,
String mediaType,
com.google.gson.JsonObject customConfig)
Converts a document to HTML using a custom configuration.
|
ServiceCall<String> |
convertDocumentToText(File document)
Converts a document to Text.
|
ServiceCall<String> |
convertDocumentToText(File document,
String mediaType)
Converts a document to Text.
|
ServiceCall<String> |
convertDocumentToText(File document,
String mediaType,
com.google.gson.JsonObject customConfig)
Converts a document to Text using a custom configuration.
|
ServiceCall<String> |
indexDocument(IndexDocumentOptions indexDocumentOptions)
Converts and indexes the document and metadata provided.
|
configureHttpClient, createServiceCall, getApiKey, getEndPoint, getName, getToken, processServiceCall, setApiKey, setAuthentication, setDefaultHeaders, setEndPoint, setSkipAuthentication, setUsernameAndPassword, toString
public static final String VERSION_DATE_2015_12_01
public DocumentConversion(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(String versionDate, String username, 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(File document)
convertDocumentToAnswer(File, String)
if you want to specify the media typedocument
- the documentAnswers
public ServiceCall<Answers> convertDocumentToAnswer(File document, 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(File document, 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<String> convertDocumentToHTML(File document)
convertDocumentToHTML(File, String)
if you want to specify the media type.document
- the documentString
public ServiceCall<String> convertDocumentToHTML(File document, 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<String> convertDocumentToHTML(File document, 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<String> convertDocumentToText(File document)
convertDocumentToText(File, String)
if you want to specify the media type.document
- the documentString
public ServiceCall<String> convertDocumentToText(File document, 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<String> convertDocumentToText(File document, 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<String> indexDocument(IndexDocumentOptions indexDocumentOptions)
indexDocumentOptions
- Specifies the options for indexing the documentString
Copyright © 2015–2016 IBM Watson. All rights reserved.