Class WebConfResourceLocator
java.lang.Object
fr.paris.lutece.portal.service.init.WebConfResourceLocator
The
WebConfResourceLocator class provides utility methods to scan and retrieve resources from
the /WEB-INF/conf/ directory and its subdirectories. This class focuses on gathering resources
related to plugin configurations, core overrides, and logging configurations.
The methods in this class support filtering resources based on file extensions, patterns, or
wildcard strings, making it useful for locating and handling specific configuration files
in a web application.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic io.github.classgraph.ResourceListReturns all resources found in the /WEB-INF/conf/ directories.Retrieves a set of paths to configuration log files (e.g., "_log.xml") found in the scanned directories.Retrieves the properties files located under the override directories (override/andoverride/plugins), in their loading order:override/pluginsis loaded afteroverride/, so its values win.Retrieves the properties files that are NOT located under the override directories (override/andoverride/plugins), in their loading order: the last one loaded wins, so the themes win over the plugins.Retrieves a set of paths to xml files found in the scanned directories.static io.github.classgraph.ResourceListgetResourcesMatchingPattern(Pattern pattern) Retrieves all resources that match the provided regular expression pattern in their paths.static io.github.classgraph.ResourceListgetResourcesMatchingWildcard(String wildcardString) Retrieves all resources that match the provided wildcard pattern in their paths.static io.github.classgraph.ResourceListgetResourcesWithExtension(String extension) Retrieves all resources with the specified file extension from the scanned directories.
-
Constructor Details
-
WebConfResourceLocator
public WebConfResourceLocator()
-
-
Method Details
-
getAllResources
public static io.github.classgraph.ResourceList getAllResources()Returns all resources found in the /WEB-INF/conf/ directories. If the resources have not been scanned yet, it will trigger a scan of the directories.- Returns:
- A list of resources found in the specified directories.
-
getResourcesWithExtension
Retrieves all resources with the specified file extension from the scanned directories. The extension is case-insensitive.- Parameters:
extension- the file extension to match (e.g., "xml").- Returns:
- A list of resources that match the specified extension.
-
getResourcesMatchingPattern
Retrieves all resources that match the provided regular expression pattern in their paths.- Parameters:
pattern- The regex pattern to match against resource paths.- Returns:
- A list of resources whose paths match the provided pattern.
-
getResourcesMatchingWildcard
Retrieves all resources that match the provided wildcard pattern in their paths. The wildcard pattern can include:- Single asterisks (*) to match any sequence of characters excluding '/'.
- Double asterisks (**) to match any sequence of characters including '/'.
- Question marks (?) to match any single character.
- Parameters:
wildcardString- The wildcard pattern to match against resource paths.- Returns:
- A list of resources whose paths match the provided wildcard pattern.
-
getPathConfLog
Retrieves a set of paths to configuration log files (e.g., "_log.xml") found in the scanned directories.- Returns:
- A set of paths to the log configuration files.
-
getPathPropertiesFileWithoutOverride
Retrieves the properties files that are NOT located under the override directories (override/andoverride/plugins), in their loading order: the last one loaded wins, so the themes win over the plugins. This is the content of the baseConfigSource.- Returns:
- A set of paths to the non-override properties files.
-
getPathOverridePropertiesFile
Retrieves the properties files located under the override directories (override/andoverride/plugins), in their loading order:override/pluginsis loaded afteroverride/, so its values win. This is the content of the overrideConfigSource, whose higher ordinal makes all of them win over the base ones.- Returns:
- A set of paths to the override properties files.
-
getPathXmlFile
Retrieves a set of paths to xml files found in the scanned directories.- Returns:
- A set of paths to xml files.
-