Package org.codelibs.fess.helper
Class ThemeHelper
java.lang.Object
org.codelibs.fess.helper.ThemeHelper
Helper class for managing theme installation and uninstallation.
Handles the extraction and deployment of theme files from JAR artifacts.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcloseQuietly(Path dir) Recursively deletes a directory and all its contents.protected PathgetJarFile(PluginHelper.Artifact artifact) Gets the JAR file path for the given artifact.protected StringgetThemeName(PluginHelper.Artifact artifact) Extracts the theme name from the artifact name.voidinstall(PluginHelper.Artifact artifact) Installs a theme from the given artifact.voiduninstall(PluginHelper.Artifact artifact) Uninstalls a theme by removing all its associated files and directories.
-
Constructor Details
-
ThemeHelper
public ThemeHelper()Default constructor for ThemeHelper.
-
-
Method Details
-
install
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
Uninstalls a theme by removing all its associated files and directories.- Parameters:
artifact- the theme artifact to uninstall
-
getThemeName
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
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
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
-