Interface WorkingDirectoryCustomizer
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface WorkingDirectoryCustomizer
A callback interface to customize a working directory.- Since:
- 4.0.0
- Author:
- Dmytro Nosan
- See Also:
addResource(Resource, String)
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static WorkingDirectoryCustomizeraddResource(Resource resource, String path)Copies a resource to a target path within the working directory.voidcustomize(Path workingDirectory, Version version)Customizes the working directory.
-
-
-
Method Detail
-
addResource
static WorkingDirectoryCustomizer addResource(Resource resource, String path)
Copies a resource to a target path within the working directory.- If the target file does not exist, it will be created. - If the target file exists, it will be replaced.
For example:WorkingDirectoryCustomizer.addResource(new ClassPathResource("cassandra.yaml"), "conf/cassandra.yaml")- Parameters:
path- The path (file only) within the working directory (e.g., conf/cassandra.yaml)resource- The resource to be copied- Returns:
- A new working directory customizer
- Throws:
NullPointerException- if the path or resource isnullIllegalArgumentException- if the target path points outside the working directory or is a directory
-
customize
void customize(Path workingDirectory, Version version) throws IOException
Customizes the working directory.- Parameters:
workingDirectory- The working directoryversion- The version- Throws:
IOException- If an I/O error occurs
-
-