Skip to main content

Sanitize | Java SDK

Create a new Sanitize client using the given builder.

SanitizeClient(Builder builder)

required parameters

Builder

Sanitize client builder.

Response Object

void

Sanitize

sanitize(SanitizeRequest request, File file)

Apply file sanitization actions according to specified rules.

required parameters

SanitizeRequest

Request parameters.

File

File to sanitize.

Response Object

SanitizeResponse

The sanitized file and information on the sanitization that was performed.

 var file = new File("/path/to/file.pdf");
 var response = client.sanitize(
     new SanitizeRequest.Builder().uploadedFileName("uploaded_file").build(),
     file
 );

Sanitize via presigned URL

requestUploadURL(SanitizeRequest request)

Apply file sanitization actions according to specified rules via a presigned URL.

required parameters

SanitizeRequest

Request parameters.

Response Object

AcceptedResponse

A presigned URL.

 var request = new SanitizeRequest.Builder()
     .transferMethod(TransferMethod.PUT_URL)
     .uploadedFileName("uploaded_file")
     .build();
 var presignedUrl = client.requestUploadURL(request);

 // Upload file to `acceptedResponse.getResult().getPutURL()`.

 // Poll for Sanitize's result.
 var response = client.pollResult(presignedUrl.getRequestId(), SanitizeResponse.class);