Redaction SDK saving text file as xlsx

Hi Team,
I have a text file when it’s redacted by the GroupDocs Redaction Java SDK the output is saving as xlsx file instead of as text. This is an unexpected behaviour as the SDK guarantees that it’s saved in native format. Please find the resources below to reproduce.

Code

    @Test
    void txtSavedAsXlsx() {
        try (Redactor redactor = new Redactor(getClass().getResourceAsStream("/bug_affected_file.txt"))) {
            RedactorChangeLog result =
                redactor.apply(new ExactPhraseRedaction("514-14-8905", new ReplacementOptions("#")));
            if (result.getStatus() != RedactionStatus.Failed) {
                try (FileOutputStream fileStream = new FileOutputStream("txt_saved_as_xlsx.txt")) {
                    RasterizationOptions options = new RasterizationOptions();
                    options.setEnabled(false);
                    redactor.save(fileStream, options);
                }
            }
        } catch (Exception e) {
            fail(e);
        }
    }

System Details
Java: 17
SDK: GroupDocs.Redaction Java
SDK Version: 21.12

File Affected
bug_affected_file.txt.zip (963 Bytes)

Expected
File should be a text file with redacted content.

Actual
File is an xlsx file with redacted content. Please rename txt_saved_as_xlsx.txt to txt_saved_as_xlsx.xlsx if we want to see the redacted data, but it’s not supposed to happen.

@shiva.k

Could you please share the resultant/output file as well? We couldn’t reproduce this issue at our end using latest API version. Please take a look at these source and output.zip (813 Bytes) files.

Hi I have tried with groupdocs redaction SDK Java 24.1 still it has same issue. Here is the output I got.
txt_saved_as_xlsx.txt.zip (7.6 KB)

This is happening only when I pass input stream, for string file path its not reproducible. Please use my Junit test, which uses InputStream.

I have tried 24.9 version which is latest as well and able to reproduce the same issue when I use InputStream.

1 Like

@shiva.k
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): REDACTIONJAVA-245

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hi in which version I can expect this fix?

@shiva.k

This ticket is still being investigated. We will notify you as soon as we have any updates regarding the fix.