@Nonnull
    @Override
    public InputStream getInputStream() throws IOException {
        return new FilterInputStream(super.getInputStream()) {

            @Override
            public void close() throws IOException {
                closeThenDeleteFile(this.in);
            }

        };
    }
This is {@link TemporaryFileSystemResource}.

@author Misagh Moayyed
@since 6.0.0
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/io/TemporaryFileSystemResource.java