Package de.aristaflow.adept2.util.io
Class RereadableContentBuilder.RcbCleanup
java.lang.Object
de.aristaflow.adept2.util.CleanupTask.AbstractCleanupTask<IOException>
de.aristaflow.adept2.util.io.RereadableContentBuilder.RcbCleanup
- All Implemented Interfaces:
CleanupTask<IOException>
- Enclosing class:
- RereadableContentBuilder
protected static final class RereadableContentBuilder.RcbCleanup
extends CleanupTask.AbstractCleanupTask<IOException>
The
This will close the output if not done yet and delete the temporary file if present and no
CleanupTask doing the clean-up (RereadableContentBuilder.close()) independently from the
RereadableContentBuilder. This allows to use it as post-mortem action of the
RereadableContentBuilder. This will close the output if not done yet and delete the temporary file if present and no
RereadableContent has been
built.-
Nested Class Summary
Nested classes/interfaces inherited from interface de.aristaflow.adept2.util.CleanupTask
CleanupTask.AbstractCleanupTask<EX extends Exception>, CleanupTask.AtomicCloseTask, CleanupTask.CloseAndResetTask, CleanupTask.MutableCloseTask -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final de.aristaflow.adept2.util.io.RereadableContentBuilder.RcbStateThe state of theRereadableContentBuildercontaining all mutable fields required for clean-up.Fields inherited from class de.aristaflow.adept2.util.CleanupTask.AbstractCleanupTask
descriptor, logger -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRcbCleanup(de.aristaflow.adept2.util.io.RereadableContentBuilder.RcbState state) Creates a new clean-up for closing as post-mortem action of aRereadableContentBuilder. -
Method Summary
Methods inherited from class de.aristaflow.adept2.util.CleanupTask.AbstractCleanupTask
getDescriptor
-
Field Details
-
state
protected final de.aristaflow.adept2.util.io.RereadableContentBuilder.RcbState stateThe state of theRereadableContentBuildercontaining all mutable fields required for clean-up.
-
-
Constructor Details
-
RcbCleanup
protected RcbCleanup(de.aristaflow.adept2.util.io.RereadableContentBuilder.RcbState state) Creates a new clean-up for closing as post-mortem action of aRereadableContentBuilder. Also used for RereadableContentBuilder.close() explicit clean-up.- Parameters:
state- The state of theRereadableContentBuildercontaining all mutable fields required for clean-up.
-
-
Method Details
-
cleanup
Closes the output stream and deletes the temporary file if noRereadableContenthas been built. This also resets theRereadableContentBuilder.stateappropriately.- Parameters:
explicit- Whether the clean-up was triggered explicitly viaCleanup.clean(). Otherwise it was triggered implicitly as a post-mortem action by the object becoming phantom reachable.- Throws:
IOException- If closing or deleting fails, anIOExceptionwill be thrown.
-