Package com.cloudconvert.resource.sync
Class TasksResource
java.lang.Object
com.cloudconvert.resource.AbstractResource
com.cloudconvert.resource.AbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>
com.cloudconvert.resource.sync.TasksResource
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class TasksResource extends AbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>
-
Field Summary
Fields inherited from class com.cloudconvert.resource.AbstractTasksResource
PATH_SEGMENT_CANCEL, PATH_SEGMENT_OPERATIONS, PATH_SEGMENT_RETRY, PATH_SEGMENT_TASKS, PATH_SEGMENT_WAITFields inherited from class com.cloudconvert.resource.AbstractResource
BEARER, HEADER_AUTHORIZATION, HEADER_USER_AGENT, INPUT_STREAM_TYPE_REFERENCE, JOB_RESPONSE_PAGEABLE_TYPE_REFERENCE, JOB_RESPONSE_TYPE_REFERENCE, MAP_STRING_TO_OBJECT_TYPE_REFERENCE, OPERATION_RESPONSE_PAGEABLE_TYPE_REFERENCE, TASK_RESPONSE_PAGEABLE_TYPE_REFERENCE, TASK_RESPONSE_TYPE_REFERENCE, USER_RESPONSE_TYPE_REFERENCE, V2, VALUE_USER_AGENT, VOID_TYPE_REFERENCE, WEBHOOKS_RESPONSE_PAGEABLE_TYPE_REFERENCE, WEBHOOKS_RESPONSE_TYPE_REFERENCE -
Constructor Summary
Constructors Constructor Description TasksResource(SettingsProvider settingsProvider, ObjectMapperProvider objectMapperProvider, RequestExecutor requestExecutor, ConvertFilesResource convertFilesResource, OptimizeFilesResource optimizeFilesResource, CaptureWebsitesResource captureWebsitesResource, MergeFilesResource mergeFilesResource, CreateArchivesResource createArchivesResource, ExecuteCommandsResource executeCommandsResource, CreateThumbnailsResource createThumbnailsResource, GetMetadataResource getMetadataResource, WriteMetadataResource writeMetadataResource, AddWatermarkResource addWatermarkResource) -
Method Summary
Modifier and Type Method Description Result<TaskResponse>archive(@NotNull CreateArchivesTaskRequest createArchivesTaskRequest)Create a task to create a ZIP, RAR, 7Z, TAR, TAR.GZ or TAR.BZ2 archive.Result<TaskResponse>cancel(@NotNull java.lang.String taskId)Cancel a task that is in status waiting or processing.Result<TaskResponse>capture(@NotNull CaptureWebsitesTaskRequest captureWebsitesTaskRequest)Create a task to convert a website to PDF or to capture a screenshot of a website (png, jpg).voidclose()Result<TaskResponse>command(@NotNull ExecuteCommandsTaskRequest executeCommandsTaskRequest)Create a task to execute a command.Result<TaskResponse>convert(@NotNull ConvertFilesTaskRequest convertFilesTaskRequest)Create a task to convert one input file from input_format to output_format.Result<Pageable<OperationResponse>>convertFormats()List all supported formats, their engines and possible options.Result<Pageable<OperationResponse>>convertFormats(@NotNull java.util.Map<Filter,java.lang.String> filters)List all supported formats, their engines and possible options.Result<Pageable<OperationResponse>>convertFormats(@NotNull java.util.Map<Filter,java.lang.String> filters, @NotNull java.util.List<Include> includes)List all supported formats, their engines and possible options.Result<Pageable<OperationResponse>>convertFormats(@NotNull java.util.Map<Filter,java.lang.String> filters, @NotNull java.util.List<Include> includes, @Nullable java.lang.Boolean alternative)List all supported formats, their engines and possible options.Result<java.lang.Void>delete(@NotNull java.lang.String taskId)Delete a task, including all data.Result<Pageable<TaskResponse>>list()List all tasks with their status, payload and result.Result<Pageable<TaskResponse>>list(@NotNull java.util.Map<Filter,java.lang.String> filters)List all tasks with their status, payload and result.Result<Pageable<TaskResponse>>list(@NotNull java.util.Map<Filter,java.lang.String> filters, @NotNull java.util.List<Include> includes)List all tasks with their status, payload and result.Result<Pageable<TaskResponse>>list(@NotNull java.util.Map<Filter,java.lang.String> filters, @NotNull java.util.List<Include> includes, @Nullable Pagination pagination)List all tasks with their status, payload and result.Result<TaskResponse>merge(@NotNull MergeFilesTaskRequest mergeFilesTaskRequest)Create a task to merge at least two files to one PDF.Result<TaskResponse>metadata(@NotNull GetMetadataTaskRequest getMetadataTaskRequest)Create a task to extract metadata from one file.Result<Pageable<OperationResponse>>operations()List all possible operations, formats, engines and possible options.Result<Pageable<OperationResponse>>operations(@NotNull java.util.Map<Filter,java.lang.String> filters)List all possible operations, formats, engines and possible options.Result<Pageable<OperationResponse>>operations(@NotNull java.util.Map<Filter,java.lang.String> filters, @NotNull java.util.List<Include> includes)List all possible operations, formats, engines and possible options.Result<Pageable<OperationResponse>>operations(@NotNull java.util.Map<Filter,java.lang.String> filters, @NotNull java.util.List<Include> includes, @Nullable java.lang.Boolean alternative)List all possible operations, formats, engines and possible options.Result<TaskResponse>optimize(@NotNull OptimizeFilesTaskRequest optimizeFilesTaskRequest)Create a task to optimize and compress a file.Result<TaskResponse>retry(@NotNull java.lang.String taskId)Create a new task, based on the payload of another task.Result<TaskResponse>show(@NotNull java.lang.String taskId)Show a task.Result<TaskResponse>show(@NotNull java.lang.String taskId, @NotNull java.util.List<Include> includes)Show a task.Result<TaskResponse>thumbnail(@NotNull CreateThumbnailsTaskRequest createThumbnailsTaskRequest)Create a task to create a thumbnail of one file.Result<TaskResponse>wait(@NotNull java.lang.String taskId)Wait until the task status is finished or error.Result<TaskResponse>watermark(@NotNull AddWatermarkTaskRequest addWatermarkTaskRequest)Create a task to add a watermark to a file.Result<TaskResponse>writeMetadata(@NotNull WriteMetadataTaskRequest writeMetadataTaskRequest)Create a task to write file metadata.Methods inherited from class com.cloudconvert.resource.AbstractTasksResource
getCancelHttpUriRequest, getDeleteHttpUriRequest, getListHttpUriRequest, getOperationsHttpUriRequest, getRetryHttpUriRequest, getShowHttpUriRequest, getWaitHttpUriRequestMethods inherited from class com.cloudconvert.resource.AbstractResource
getHttpEntity, getHttpEntity, getHttpUriRequest, getHttpUriRequest, getJson, getSyncUri, getSyncUri, getUri, getUri, requestToMapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
TasksResource
public TasksResource(SettingsProvider settingsProvider, ObjectMapperProvider objectMapperProvider, RequestExecutor requestExecutor, ConvertFilesResource convertFilesResource, OptimizeFilesResource optimizeFilesResource, CaptureWebsitesResource captureWebsitesResource, MergeFilesResource mergeFilesResource, CreateArchivesResource createArchivesResource, ExecuteCommandsResource executeCommandsResource, CreateThumbnailsResource createThumbnailsResource, GetMetadataResource getMetadataResource, WriteMetadataResource writeMetadataResource, AddWatermarkResource addWatermarkResource)
-
-
Method Details
-
show
public Result<TaskResponse> show(@NotNull @NotNull java.lang.String taskId) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceShow a task. Requires the task.read scope.- Specified by:
showin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
taskId- task id- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
show
public Result<TaskResponse> show(@NotNull @NotNull java.lang.String taskId, @NotNull @NotNull java.util.List<Include> includes) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceShow a task. Requires the task.read scope.- Specified by:
showin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
taskId- task idincludes- (optional) Include retries, depends_on_tasks, payload and/or job in the result. Multiple include values are separated by , (comma).- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
wait
public Result<TaskResponse> wait(@NotNull @NotNull java.lang.String taskId) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceWait until the task status is finished or error. This makes the request block until the task has been completed. Requires the task.read scope.We do not recommend using this for long running jobs (e.g. video encodings). Your system might automatically time out requests if there is not data transferred for a longer time.
In general, please avoid to block your application until a CloudConvert job completes. There might be cases in which we need to queue your task which results in longer processing times than usual. Using an asynchronous approach with webhooks is beneficial in such cases.
- Specified by:
waitin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
taskId- task id- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
list
public Result<Pageable<TaskResponse>> list() throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceList all tasks with their status, payload and result. Requires the task.read scope.- Specified by:
listin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
list
public Result<Pageable<TaskResponse>> list(@NotNull @NotNull java.util.Map<Filter,java.lang.String> filters) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceList all tasks with their status, payload and result. Requires the task.read scope.- Specified by:
listin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
filters- (optional) Filters: - job_id - The result will be filtered to include only tasks for a specific Job ID. - status - The result will be filtered to include only tasks with a specific status (waiting, processing, finished or error). - operation - Filter result to only include tasks of with a matching operation (for example convert or import/s3).- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
list
public Result<Pageable<TaskResponse>> list(@NotNull @NotNull java.util.Map<Filter,java.lang.String> filters, @NotNull @NotNull java.util.List<Include> includes) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceList all tasks with their status, payload and result. Requires the task.read scope.- Specified by:
listin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
filters- (optional) Filters: - job_id - The result will be filtered to include only tasks for a specific Job ID. - status - The result will be filtered to include only tasks with a specific status (waiting, processing, finished or error). - operation - Filter result to only include tasks of with a matching operation (for example convert or import/s3).includes- (optional) Include retries and/or depends_on_tasks in the result.- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
list
public Result<Pageable<TaskResponse>> list(@NotNull @NotNull java.util.Map<Filter,java.lang.String> filters, @NotNull @NotNull java.util.List<Include> includes, @Nullable @Nullable Pagination pagination) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceList all tasks with their status, payload and result. Requires the task.read scope.- Specified by:
listin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
filters- (optional) Filters: - job_id - The result will be filtered to include only tasks for a specific Job ID. - status - The result will be filtered to include only tasks with a specific status (waiting, processing, finished or error). - operation - Filter result to only include tasks of with a matching operation (for example convert or import/s3).includes- (optional) Include retries and/or depends_on_tasks in the result.pagination- (optional) Pagination: - per_page - Number of tasks per page, defaults to 100. - page - The result page to show.- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
cancel
public Result<TaskResponse> cancel(@NotNull @NotNull java.lang.String taskId) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceCancel a task that is in status waiting or processing. Requires the task.write scope.- Specified by:
cancelin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
taskId- task id- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
retry
public Result<TaskResponse> retry(@NotNull @NotNull java.lang.String taskId) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceCreate a new task, based on the payload of another task. Requires the task.write scope.- Specified by:
retryin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
taskId- task id- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
delete
public Result<java.lang.Void> delete(@NotNull @NotNull java.lang.String taskId) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceDelete a task, including all data. Requires the task.write scope. Tasks are deleted automatically 24 hours after they have ended.- Specified by:
deletein classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
taskId- task id- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
operations
public Result<Pageable<OperationResponse>> operations() throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceList all possible operations, formats, engines and possible options.- Specified by:
operationsin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
operations
public Result<Pageable<OperationResponse>> operations(@NotNull @NotNull java.util.Map<Filter,java.lang.String> filters) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceList all possible operations, formats, engines and possible options.- Specified by:
operationsin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
filters- (optional) Filters: - operation - The result will be filtered to include only possible operations with a matching operation name (e.g. convert or optimize). - input_format - The result will be filtered to include only possible conversions with a matching input format. - output_format - The result will be filtered to include only possible conversions with a matching output format. - engine - Filter result to only include conversions with a matching engine name. - engine_version - Filter result to only include conversions with a matching engine version.- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
operations
public Result<Pageable<OperationResponse>> operations(@NotNull @NotNull java.util.Map<Filter,java.lang.String> filters, @NotNull @NotNull java.util.List<Include> includes) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceList all possible operations, formats, engines and possible options.- Specified by:
operationsin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
filters- (optional) Filters: - operation - The result will be filtered to include only possible operations with a matching operation name (e.g. convert or optimize). - input_format - The result will be filtered to include only possible conversions with a matching input format. - output_format - The result will be filtered to include only possible conversions with a matching output format. - engine - Filter result to only include conversions with a matching engine name. - engine_version - Filter result to only include conversions with a matching engine version.includes- (optional) Include options and/or engine_versions in the result.- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
operations
public Result<Pageable<OperationResponse>> operations(@NotNull @NotNull java.util.Map<Filter,java.lang.String> filters, @NotNull @NotNull java.util.List<Include> includes, @Nullable @Nullable java.lang.Boolean alternative) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceList all possible operations, formats, engines and possible options.- Specified by:
operationsin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
filters- (optional) Filters: - operation - The result will be filtered to include only possible operations with a matching operation name (e.g. convert or optimize). - input_format - The result will be filtered to include only possible conversions with a matching input format. - output_format - The result will be filtered to include only possible conversions with a matching output format. - engine - Filter result to only include conversions with a matching engine name. - engine_version - Filter result to only include conversions with a matching engine version.includes- (optional) Include options and/or engine_versions in the result.alternative- (optional) For some formats multiple alternative engines are available. If set to true, the result includes these alternative conversion types. Default to false.- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
convert
public Result<TaskResponse> convert(@NotNull @NotNull ConvertFilesTaskRequest convertFilesTaskRequest) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceCreate a task to convert one input file from input_format to output_format. Requires the task.write scope.- Specified by:
convertin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
convertFilesTaskRequest-ConvertFilesTaskRequest- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
convertFormats
public Result<Pageable<OperationResponse>> convertFormats() throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceList all supported formats, their engines and possible options.- Specified by:
convertFormatsin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
convertFormats
public Result<Pageable<OperationResponse>> convertFormats(@NotNull @NotNull java.util.Map<Filter,java.lang.String> filters) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceList all supported formats, their engines and possible options.- Specified by:
convertFormatsin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
filters- (optional) Filters: - input_format - The result will be filtered to include only possible conversions with a matching input format. - output_format - The result will be filtered to include only possible conversions with a matching output format. - engine - Filter result to only include conversions with a matching engine name. - engine_version - Filter result to only include conversions with a matching engine version.- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
convertFormats
public Result<Pageable<OperationResponse>> convertFormats(@NotNull @NotNull java.util.Map<Filter,java.lang.String> filters, @NotNull @NotNull java.util.List<Include> includes) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceList all supported formats, their engines and possible options.- Specified by:
convertFormatsin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
filters- (optional) Filters: - input_format - The result will be filtered to include only possible conversions with a matching input format. - output_format - The result will be filtered to include only possible conversions with a matching output format. - engine - Filter result to only include conversions with a matching engine name. - engine_version - Filter result to only include conversions with a matching engine version.includes- (optional) Include options and/or engine_versions in the result.- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
convertFormats
public Result<Pageable<OperationResponse>> convertFormats(@NotNull @NotNull java.util.Map<Filter,java.lang.String> filters, @NotNull @NotNull java.util.List<Include> includes, @Nullable @Nullable java.lang.Boolean alternative) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceList all supported formats, their engines and possible options.- Specified by:
convertFormatsin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
filters- (optional) Filters: - input_format - The result will be filtered to include only possible conversions with a matching input format. - output_format - The result will be filtered to include only possible conversions with a matching output format. - engine - Filter result to only include conversions with a matching engine name. - engine_version - Filter result to only include conversions with a matching engine version.includes- (optional) Include options and/or engine_versions in the result.alternative- (optional) For some formats multiple alternative engines are available. If set to true, the result includes these alternative conversion types. Default to false.- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
optimize
public Result<TaskResponse> optimize(@NotNull @NotNull OptimizeFilesTaskRequest optimizeFilesTaskRequest) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceCreate a task to optimize and compress a file. Currently supported formats are PDF, PNG and JPG.- Specified by:
optimizein classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
optimizeFilesTaskRequest-OptimizeFilesTaskRequest- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
capture
public Result<TaskResponse> capture(@NotNull @NotNull CaptureWebsitesTaskRequest captureWebsitesTaskRequest) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceCreate a task to convert a website to PDF or to capture a screenshot of a website (png, jpg).- Specified by:
capturein classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
captureWebsitesTaskRequest-CaptureWebsitesTaskRequest- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
merge
public Result<TaskResponse> merge(@NotNull @NotNull MergeFilesTaskRequest mergeFilesTaskRequest) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceCreate a task to merge at least two files to one PDF. If input files are not PDFs yet, they are automatically converted to PDF.- Specified by:
mergein classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
mergeFilesTaskRequest-MergeFilesTaskRequest- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
archive
public Result<TaskResponse> archive(@NotNull @NotNull CreateArchivesTaskRequest createArchivesTaskRequest) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceCreate a task to create a ZIP, RAR, 7Z, TAR, TAR.GZ or TAR.BZ2 archive.- Specified by:
archivein classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
createArchivesTaskRequest-CreateArchivesTaskRequest- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
command
public Result<TaskResponse> command(@NotNull @NotNull ExecuteCommandsTaskRequest executeCommandsTaskRequest) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceCreate a task to execute a command. Currently, ffmpeg, imagemagick and graphicsmagick commands re supported. You can access the files from the input task in the /input/{taskName}/ (For example: /input/import-1/) directory. All files that are created in the /output/ directory are available for following tasks (e.g. export tasks).- Specified by:
commandin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
executeCommandsTaskRequest-ExecuteCommandsTaskRequest- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
thumbnail
public Result<TaskResponse> thumbnail(@NotNull @NotNull CreateThumbnailsTaskRequest createThumbnailsTaskRequest) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceCreate a task to create a thumbnail of one file. Requires the task.write scope.- Specified by:
thumbnailin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
createThumbnailsTaskRequest-CreateThumbnailsTaskRequest- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
metadata
public Result<TaskResponse> metadata(@NotNull @NotNull GetMetadataTaskRequest getMetadataTaskRequest) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceCreate a task to extract metadata from one file. Requires the task.write scope.- Specified by:
metadatain classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
getMetadataTaskRequest-GetMetadataTaskRequest- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
writeMetadata
public Result<TaskResponse> writeMetadata(@NotNull @NotNull WriteMetadataTaskRequest writeMetadataTaskRequest) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceCreate a task to write file metadata.- Specified by:
writeMetadatain classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
writeMetadataTaskRequest-WriteMetadataTaskRequest- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
watermark
public Result<TaskResponse> watermark(@NotNull @NotNull AddWatermarkTaskRequest addWatermarkTaskRequest) throws java.io.IOException, java.net.URISyntaxException, CloudConvertClientException, CloudConvertServerExceptionDescription copied from class:AbstractTasksResourceCreate a task to add a watermark to a file. Requires the task.write scope.- Specified by:
watermarkin classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Parameters:
addWatermarkTaskRequest-AddWatermarkTaskRequest- Returns:
AbstractTasksResource- Throws:
java.io.IOExceptionjava.net.URISyntaxExceptionCloudConvertClientExceptionCloudConvertServerException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classAbstractTasksResource<Result<TaskResponse>,Result<Pageable<TaskResponse>>,Result<java.lang.Void>,Result<Pageable<OperationResponse>>>- Throws:
java.io.IOException
-