Interface GeneratedFile
- All Superinterfaces:
Immutable
- All Known Implementing Classes:
AbstractGeneratedFile,AbstractGeneratedTextFile
The contents of a generated file and its
GeneratedFileLifecycle.-
Method Summary
Modifier and TypeMethodDescriptionReturn the lifecycle governing this file.static GeneratedFileof(GeneratedFileLifecycle lifecycle, ByteSource body) Create a newGeneratedFilewith the specifiedByteSourcebody.static GeneratedFileof(GeneratedFileLifecycle lifecycle, CharSource body) Create a newGeneratedFilewith the specifiedCharSourcebody.static GeneratedFileof(GeneratedFileLifecycle lifecycle, CharSequence body) Create a newGeneratedFilewith the specifiedCharSequencebody.voidwriteBody(OutputStream output) Write the body of this file into specifiedOutputStream.
-
Method Details
-
getLifecycle
GeneratedFileLifecycle getLifecycle()Return the lifecycle governing this file.- Returns:
- Governing lifecycle
-
writeBody
Write the body of this file into specifiedOutputStream.- Parameters:
output- stream where to write the output- Throws:
IOException- when the stream reports an IOExceptionNullPointerException- ifoutputisnull
-
of
Create a newGeneratedFilewith the specifiedCharSequencebody. The body will be encoded inStandardCharsets.UTF_8.- Parameters:
lifecycle- File lifecyclebody- File body- Returns:
- A GeneratedFile.
- Throws:
NullPointerException- if any argument isnull
-
of
Create a newGeneratedFilewith the specifiedCharSourcebody. The body will be encoded inStandardCharsets.UTF_8.- Parameters:
lifecycle- File lifecyclebody- File body- Returns:
- A GeneratedFile.
- Throws:
NullPointerException- if any argument isnull
-
of
Create a newGeneratedFilewith the specifiedByteSourcebody. The body will be written as is.- Parameters:
lifecycle- File lifecyclebody- File body- Returns:
- A GeneratedFile.
- Throws:
NullPointerException- if any argument isnull
-