Package au.sfr.helm.writer
Class TapeArchiveChartWriter
- java.lang.Object
-
- org.microbean.helm.chart.AbstractChartWriter
-
- org.microbean.helm.chart.AbstractArchiveChartWriter
-
- au.sfr.helm.writer.TapeArchiveChartWriter
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class TapeArchiveChartWriter extends org.microbean.helm.chart.AbstractArchiveChartWriterAnAbstractArchiveChartWriterthat savesChartOuterClass.ChartOrBuilderobjects to a suppliedOutputStreamin TAR format, using aTarOutputStreaminternally.
-
-
Constructor Summary
Constructors Constructor Description TapeArchiveChartWriter(java.io.OutputStream outputStream)Creates a newTapeArchiveChartWriter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes thisTapeArchiveChartWriterby closing its underlyingTarOutputStream.protected voidwriteEntry(org.microbean.helm.chart.AbstractChartWriter.Context context, java.lang.String path, java.lang.String contents)Creates a newTarHeaderand aTarEntrywrapping it and writes it and the suppliedcontentsto the underlyingTarOutputStream.-
Methods inherited from class org.microbean.helm.chart.AbstractArchiveChartWriter
beginWrite, endWrite, writeConfig, writeFile, writeMetadata, writeTemplate
-
-
-
-
Constructor Detail
-
TapeArchiveChartWriter
public TapeArchiveChartWriter(java.io.OutputStream outputStream)
Creates a newTapeArchiveChartWriter.- Parameters:
outputStream- theOutputStreamto write to; must not benulland 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.IOExceptionCreates a newTarHeaderand aTarEntrywrapping it and writes it and the suppliedcontentsto the underlyingTarOutputStream.- Specified by:
writeEntryin classorg.microbean.helm.chart.AbstractArchiveChartWriter- Parameters:
context- theAbstractChartWriter.Contextdescribing the write operation in effect; must not benullpath- the path within a tape archive to write; interpreted as being relative to the current chart path; must not benullor emptycontents- the contents to write; must not benull- Throws:
java.io.IOException- if a write error occursjava.lang.NullPointerException- ifcontext,pathorcontentsisnulljava.lang.IllegalArgumentException- ifpathis empty
-
close
public void close() throws java.io.IOExceptionCloses thisTapeArchiveChartWriterby closing its underlyingTarOutputStream. ThisTapeArchiveChartWritercannot be used again.- Throws:
java.io.IOException- if there was a problem closing the underlyingTarOutputStream
-
-