Package org.springframework.aot.generate
Class FileSystemGeneratedFiles
java.lang.Object
org.springframework.aot.generate.FileSystemGeneratedFiles
- All Implemented Interfaces:
GeneratedFiles
GeneratedFiles
implementation that stores generated files using a
FileSystem
.- Since:
- 6.0
- Author:
- Phillip Webb, Stephane Nicoll
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.aot.generate.GeneratedFiles
GeneratedFiles.FileHandler, GeneratedFiles.Kind
-
Constructor Summary
ConstructorDescriptionFileSystemGeneratedFiles
(Path root) Create a newFileSystemGeneratedFiles
instance with all files stored under the specificroot
.Create a newFileSystemGeneratedFiles
instance with all files stored under the root provided by the givenFunction
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleFile
(GeneratedFiles.Kind kind, String path, ThrowingConsumer<GeneratedFiles.FileHandler> handler) Handle a generated file of the specifiedGeneratedFiles.Kind
with the given handler.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.aot.generate.GeneratedFiles
addClassFile, addFile, addFile, addFile, addResourceFile, addResourceFile, addResourceFile, addSourceFile, addSourceFile, addSourceFile, addSourceFile
-
Constructor Details
-
FileSystemGeneratedFiles
Create a newFileSystemGeneratedFiles
instance with all files stored under the specificroot
. The following subdirectories are created for the different filekinds
:sources
resources
classes
- Parameters:
root
- the root path- See Also:
-
FileSystemGeneratedFiles
Create a newFileSystemGeneratedFiles
instance with all files stored under the root provided by the givenFunction
.- Parameters:
roots
- a function that returns the root to use for the givenGeneratedFiles.Kind
-
-
Method Details
-
handleFile
public void handleFile(GeneratedFiles.Kind kind, String path, ThrowingConsumer<GeneratedFiles.FileHandler> handler) Description copied from interface:GeneratedFiles
Handle a generated file of the specifiedGeneratedFiles.Kind
with the given handler. The file handler lets you consume the content of the already generated file, if any and provide a way to override its content if necessary.- Specified by:
handleFile
in interfaceGeneratedFiles
- Parameters:
kind
- the kind of filepath
- the relative path of the filehandler
- a consumer of aGeneratedFiles.FileHandler
for the file
-