Sanitize | Java SDK
Create a new Sanitize client using the given builder.
SanitizeClient(Builder builder)Sanitize
sanitize(SanitizeRequest request, File file)Apply file sanitization actions according to specified rules.
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.
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);