Package org.springframework.aot.generate
Class InMemoryGeneratedFiles
java.lang.Object
org.springframework.aot.generate.InMemoryGeneratedFiles
- All Implemented Interfaces:
 GeneratedFiles
GeneratedFiles implementation that keeps generated files in-memory.- Since:
 - 6.0
 - Author:
 - Phillip Webb
 
- 
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.aot.generate.GeneratedFiles
GeneratedFiles.Kind - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddFile(GeneratedFiles.Kind kind, String path, InputStreamSource content) Add a generated file of the specifiedGeneratedFiles.Kindwith content from the givenInputStreamSource.getGeneratedFile(GeneratedFiles.Kind kind, String path) Return theInputStreamSourceof specified file.getGeneratedFileContent(GeneratedFiles.Kind kind, String path) Return the content of the specified file.Return aMapof the generated files of a specificGeneratedFiles.Kind.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.aot.generate.GeneratedFiles
addClassFile, addFile, addFile, addResourceFile, addResourceFile, addResourceFile, addSourceFile, addSourceFile, addSourceFile, addSourceFile 
- 
Constructor Details
- 
InMemoryGeneratedFiles
public InMemoryGeneratedFiles() 
 - 
 - 
Method Details
- 
addFile
Description copied from interface:GeneratedFilesAdd a generated file of the specifiedGeneratedFiles.Kindwith content from the givenInputStreamSource.- Specified by:
 addFilein interfaceGeneratedFiles- Parameters:
 kind- the kind of file being writtenpath- the relative path of the filecontent- anInputStreamSourcethat will provide an input stream containing the file contents
 - 
getGeneratedFiles
Return aMapof the generated files of a specificGeneratedFiles.Kind.- Parameters:
 kind- the kind of generated file- Returns:
 - a 
Mapof paths toInputStreamSourceinstances 
 - 
getGeneratedFileContent
@Nullable public String getGeneratedFileContent(GeneratedFiles.Kind kind, String path) throws IOException Return the content of the specified file.- Parameters:
 kind- the kind of generated filepath- the path of the file- Returns:
 - the file content or 
nullif no file could be found - Throws:
 IOException- on read error
 - 
getGeneratedFile
Return theInputStreamSourceof specified file.- Parameters:
 kind- the kind of generated filepath- the path of the file- Returns:
 - the file source or 
nullif no file could be found 
 
 -