This method can be used when for some reason files have non-standard extensions or if its format is supported, but not pre-configured. For instance, all kinds of plain text files (batch, command files, etc.) could be opened. In this case you do not need to create your own format handler. As it is shown below, you can add file extension (e.g. “.dump”) as being handled by the same DocumentFormatInstance as all plain text files:
RedactorConfigurationconfig=DocumentFormatInstance.getDefaultConfiguration();DocumentFormatConfigurationsettings=config.findFormat(".txt");settings.setExtensionFilter(settings.getExtensionFilter()+",.dump");finalRedactorredactor=newRedactor("sample.dump");try{// Here we can use the document instance to perform redactions
}finally{redactor.close();}
sample.dump is the sample file used in this example. Click here to download it.
In detail, creating your own document format instances is covered in another article.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
On this page
Ask AI
Ask anything about this page — the answer is based on its content.
Searching the docs and writing an answer…
Something went wrong while getting an answer. Please try again in a moment.