class AbstractReencryptMojo extends AbstractFileJasyptMojo {
    /** {@inheritDoc} */
    protected void run(final EncryptionService newService, final Path path, String encryptPrefix, String encryptSuffix, String decryptPrefix, String decryptSuffix) throws MojoExecutionException {<FILL_FUNCTION_BODY>}

    private String decrypt(final Path path, String encryptPrefix, String encryptSuffix, String decryptPrefix, String decryptSuffix) throws MojoExecutionException {
        log.info("Decrypting file " + path);
        try {
            String contents = FileService.read(path);
            return getOldEncryptionService().decrypt(contents, encryptPrefix, encryptSuffix, decryptPrefix, decryptSuffix);
        } catch (Exception e) {
            throw new MojoExecutionException("Error Decrypting: " + e.getMessage(), e);
        }
    }

    private EncryptionService getOldEncryptionService() {
        JasyptEncryptorConfigurationProperties properties = new JasyptEncryptorConfigurationProperties();

        configure(properties);

        StringEncryptor encryptor = new StringEncryptorBuilder(properties, "jasypt.plugin.old").build();
        return new EncryptionService(encryptor);
    }

    /**
     * <p>configure.</p>
     *
     * @param properties a {@link com.ulisesbocchio.jasyptspringboot.properties.JasyptEncryptorConfigurationProperties} object
     */
    protected abstract void configure(JasyptEncryptorConfigurationProperties properties);

    /**
     * <p>setIfNotNull.</p>
     *
     * @param setter a {@link java.util.function.Consumer} object
     * @param value a T object
     * @param <T> a T class
     */
    protected <T> void setIfNotNull(Consumer<T> setter, T value) {
        if (value != null) {
            setter.accept(value);
        }
    }
}

        String decryptedContents = decrypt(path, encryptPrefix, encryptSuffix, decryptPrefix, decryptSuffix);

        log.info("Re-encrypting file " + path);
        try {
            String encryptedContents = newService.encrypt(decryptedContents, encryptPrefix, encryptSuffix, decryptPrefix, decryptSuffix);
            FileService.write(path, encryptedContents);
        } catch (Exception e) {
            throw new MojoExecutionException("Error Re-encrypting: " + e.getMessage(), e);
        }
    
<methods>public non-sealed void <init>() <variables>private java.lang.String path