Skip to content

toolarium/toolarium-sanitize-content

Repository files navigation

License Maven Central javadoc

toolarium-sanitize-content

Implements a sanitize content java library.

Built With

  • cb - The toolarium common build

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Gradle:

dependencies {
    implementation "com.github.toolarium:toolarium-sanitize-content:1.0.1"
}

Maven:

<dependency>
    <groupId>com.github.toolarium</groupId>
    <artifactId>toolarium-sanitize-content</artifactId>
    <version>1.0.1</version>
</dependency>

Getting Started

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);

Installing

Add the annoation processor to you project or simple use the common build.