Implements a sanitize content java library.
- cb - The toolarium common build
We use SemVer for versioning. For the versions available, see the tags on this repository.
dependencies {
implementation "com.github.toolarium:toolarium-sanitize-content:1.0.1"
}
<dependency>
<groupId>com.github.toolarium</groupId>
<artifactId>toolarium-sanitize-content</artifactId>
<version>1.0.1</version>
</dependency>
Different file types can contain executable code as example java script. This library allows to eliminate the executable code.
String filename = "test.pdf";
SanitizeContentResult result = SanitizeContentFactory.getInstance().getSanitizeContentProcessor().sanitize(filename,
new FileInputStream(Paths.get("src/test/resources",filename).toFile()),
new FileOutputStream(Paths.get("build", filename).toFile()),
null);
Add the annoation processor to you project or simple use the common build.