Class RereadableContentBuilder.RcbCleanup

    • Field Detail

      • state

        protected final de.aristaflow.adept2.util.io.RereadableContentBuilder.RcbState state
        The state of the RereadableContentBuilder containing all mutable fields required for clean-up.
    • Constructor Detail

      • RcbCleanup

        protected RcbCleanup​(de.aristaflow.adept2.util.io.RereadableContentBuilder.RcbState state)
        Creates a new clean-up for closing as post-mortem action of a RereadableContentBuilder. Also used for RereadableContentBuilder.close() explicit clean-up.
        Parameters:
        state - The state of the RereadableContentBuilder containing all mutable fields required for clean-up.
    • Method Detail

      • cleanup

        public void cleanup​(boolean explicit)
                     throws IOException
        Closes the output stream and deletes the temporary file if no RereadableContent has been built. This also resets the RereadableContentBuilder.state appropriately.
        Parameters:
        explicit - Whether the clean-up was triggered explicitly via Cleanup.clean(). Otherwise it was triggered implicitly as a post-mortem action by the object becoming phantom reachable.
        Throws:
        IOException - If closing or deleting fails, an IOException will be thrown.