Class SingleResourceProjectContributor
java.lang.Object
io.spring.initializr.generator.project.contributor.SingleResourceProjectContributor
- All Implemented Interfaces:
ProjectContributor
,org.springframework.core.Ordered
ProjectContributor
that contributes a single file, identified by a resource
pattern, to a generated project.- Author:
- Andy Wilkinson
- See Also:
-
PathMatchingResourcePatternResolver
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorsConstructorDescriptionSingleResourceProjectContributor
(String relativePath, String resourcePattern) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
contribute
(Path projectRoot) Contribute additional resources to the project in the specified root directory.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.spring.initializr.generator.project.contributor.ProjectContributor
getOrder
-
Constructor Details
-
SingleResourceProjectContributor
Create a new instance.- Parameters:
relativePath
- the relative path in the generated structure.resourcePattern
- the pattern to use to locate the resource to copy to the project structure- See Also:
-
PathMatchingResourcePatternResolver.getResource(String)
-
-
Method Details
-
contribute
Description copied from interface:ProjectContributor
Contribute additional resources to the project in the specified root directory.- Specified by:
contribute
in interfaceProjectContributor
- Parameters:
projectRoot
- the root directory of the project- Throws:
IOException
- if contributing a resource failed
-