Class ThemeHelper

java.lang.Object
org.codelibs.fess.helper.ThemeHelper

public class ThemeHelper extends Object
Helper class for managing theme installation and uninstallation. Handles the extraction and deployment of theme files from JAR artifacts.
  • Constructor Details

    • ThemeHelper

      public ThemeHelper()
      Default constructor for ThemeHelper.
  • Method Details

    • install

      public void install(PluginHelper.Artifact artifact)
      Installs a theme from the given artifact. Extracts theme files from the JAR and deploys them to appropriate directories.
      Parameters:
      artifact - the theme artifact to install
      Throws:
      ThemeException - if installation fails
    • uninstall

      public void uninstall(PluginHelper.Artifact artifact)
      Uninstalls a theme by removing all its associated files and directories.
      Parameters:
      artifact - the theme artifact to uninstall
    • getThemeName

      protected String getThemeName(PluginHelper.Artifact artifact)
      Extracts the theme name from the artifact name.
      Parameters:
      artifact - the theme artifact
      Returns:
      the theme name
      Throws:
      ThemeException - if theme name cannot be determined
    • closeQuietly

      protected void closeQuietly(Path dir)
      Recursively deletes a directory and all its contents. Does not throw exceptions, only logs warnings if deletion fails.
      Parameters:
      dir - the directory to delete
    • getJarFile

      protected Path getJarFile(PluginHelper.Artifact artifact)
      Gets the JAR file path for the given artifact.
      Parameters:
      artifact - the theme artifact
      Returns:
      the path to the JAR file
      Throws:
      ThemeException - if the JAR file does not exist