@Override
    public boolean uninstall(UninstallerContext context) throws UserCanceledException
    {
        final File installationDirectory = context.getInstallationDirectory();

        File libDirectory = new File(installationDirectory, "lib");

        // If the directory still exists, remove all JAR files.
        boolean result = true;
        if (libDirectory.exists() && libDirectory.isDirectory()) {
            File[] jars = libDirectory.listFiles((dir, name) -> name.endsWith(".jar"));
            if (jars != null) {
                for (File jar : jars) {
                    if (!jar.delete()) {
                        result = false;
                    }
                }
            }
        }

        return result;
    }
Used with the Install4J installer to uninstall the remaining files within
the Openfire install.
starter/src/main/java/org/jivesoftware/openfire/launcher/Uninstaller.java