Class TapeArchiveChartWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class TapeArchiveChartWriter
    extends org.microbean.helm.chart.AbstractArchiveChartWriter
    An AbstractArchiveChartWriter that saves ChartOuterClass.ChartOrBuilder objects to a supplied OutputStream in TAR format, using a TarOutputStream internally.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.microbean.helm.chart.AbstractChartWriter

        org.microbean.helm.chart.AbstractChartWriter.Context
    • Constructor Summary

      Constructors 
      Constructor Description
      TapeArchiveChartWriter​(java.io.OutputStream outputStream)
      Creates a new TapeArchiveChartWriter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes this TapeArchiveChartWriter by closing its underlying TarOutputStream.
      protected void writeEntry​(org.microbean.helm.chart.AbstractChartWriter.Context context, java.lang.String path, java.lang.String contents)
      Creates a new TarHeader and a TarEntry wrapping it and writes it and the supplied contents to the underlying TarOutputStream.
      • Methods inherited from class org.microbean.helm.chart.AbstractArchiveChartWriter

        beginWrite, endWrite, writeConfig, writeFile, writeMetadata, writeTemplate
      • Methods inherited from class org.microbean.helm.chart.AbstractChartWriter

        createYaml, toYAML, write, write, writeSubchart
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TapeArchiveChartWriter

        public TapeArchiveChartWriter​(java.io.OutputStream outputStream)
        Creates a new TapeArchiveChartWriter.
        Parameters:
        outputStream - the OutputStream to write to; must not be null and should be buffered at some level
        See Also:
        AbstractArchiveChartWriter(), TarOutputStream(OutputStream)
    • Method Detail

      • writeEntry

        protected void writeEntry​(org.microbean.helm.chart.AbstractChartWriter.Context context,
                                  java.lang.String path,
                                  java.lang.String contents)
                           throws java.io.IOException
        Creates a new TarHeader and a TarEntry wrapping it and writes it and the supplied contents to the underlying TarOutputStream.
        Specified by:
        writeEntry in class org.microbean.helm.chart.AbstractArchiveChartWriter
        Parameters:
        context - the AbstractChartWriter.Context describing the write operation in effect; must not be null
        path - the path within a tape archive to write; interpreted as being relative to the current chart path; must not be null or empty
        contents - the contents to write; must not be null
        Throws:
        java.io.IOException - if a write error occurs
        java.lang.NullPointerException - if context, path or contents is null
        java.lang.IllegalArgumentException - if path is empty
      • close

        public void close()
                   throws java.io.IOException
        Closes this TapeArchiveChartWriter by closing its underlying TarOutputStream. This TapeArchiveChartWriter cannot be used again.
        Throws:
        java.io.IOException - if there was a problem closing the underlying TarOutputStream