Class GeneratedFiles.FileHandler
java.lang.Object
org.springframework.aot.generate.GeneratedFiles.FileHandler
- Enclosing interface:
- GeneratedFiles
Provide access to a particular file and offer convenient methods to retrieve,
save, or override its content.
- Since:
- 6.2
- Author:
- Phillip Webb, Brian Clozel, Stephane Nicoll
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedFileHandler(boolean exists, Supplier<InputStreamSource> existingContent) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract voidcopy(InputStreamSource content, boolean override) voidcreate(InputStreamSource content) Create a file with the given content.booleanexists()Specify whether the file already exists.Return anInputStreamSourcefor the content of the file ornullif the file does not exist.voidoverride(InputStreamSource content) Override the content of the file handled by this instance using the given content.
- 
Constructor Details- 
FileHandler
 
- 
- 
Method Details- 
existspublic boolean exists()Specify whether the file already exists.- Returns:
- trueif the file already exists
 
- 
getContentReturn anInputStreamSourcefor the content of the file ornullif the file does not exist.
- 
createCreate a file with the given content.- Throws:
- IllegalStateException- if the file already exists
 
- 
overrideOverride the content of the file handled by this instance using the given content. If the file does not exist, it is created.
- 
copy
 
-