Class FilePatternResourceHintsRegistrar
java.lang.Object
org.springframework.aot.hint.support.FilePatternResourceHintsRegistrar
Register the necessary resource hints for loading files from the classpath,
based on file name prefixes and file extensions with convenience to support
multiple classpath locations.
Only registers hints for matching classpath locations, which allows for several locations to be provided without contributing unnecessary hints.
- Since:
- 6.0
- Author:
- Stephane Nicoll, Sam Brannen
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder forFilePatternResourceHintsRegistrar
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionforClassPathLocations
(String... classpathLocations) Configure the registrar with the specified classpath locations.forClassPathLocations
(List<String> classpathLocations) Configure the registrar with the specified classpath locations.void
registerHints
(ResourceHints hints, ClassLoader classLoader) Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
FilePatternResourceHintsRegistrar
@Deprecated(since="6.0.12", forRemoval=true) public FilePatternResourceHintsRegistrar(List<String> filePrefixes, List<String> classpathLocations, List<String> fileExtensions) Deprecated, for removal: This API element is subject to removal in a future version.as of 6.0.12 in favor of the builderCreate a new instance for the specified file prefixes, classpath locations, and file extensions.- Parameters:
filePrefixes
- the file prefixesclasspathLocations
- the classpath locationsfileExtensions
- the file extensions (starting with a dot)
-
-
Method Details
-
registerHints
@Deprecated(since="6.0.12", forRemoval=true) public void registerHints(ResourceHints hints, @Nullable ClassLoader classLoader) Deprecated, for removal: This API element is subject to removal in a future version. -
forClassPathLocations
public static FilePatternResourceHintsRegistrar.Builder forClassPathLocations(String... classpathLocations) Configure the registrar with the specified classpath locations.- Parameters:
classpathLocations
- the classpath locations- Returns:
- a
FilePatternResourceHintsRegistrar.Builder
to further configure the registrar - Since:
- 6.0.12
- See Also:
-
forClassPathLocations
public static FilePatternResourceHintsRegistrar.Builder forClassPathLocations(List<String> classpathLocations) Configure the registrar with the specified classpath locations.- Parameters:
classpathLocations
- the classpath locations- Returns:
- a
FilePatternResourceHintsRegistrar.Builder
to further configure the registrar - Since:
- 6.0.12
- See Also:
-