Class SessionWriter.ExportSupport

    • Constructor Detail

      • ExportSupport

        public ExportSupport​(Document doc,
                             int layerIndex)
        Constructs a new ExportSupport.
        Parameters:
        doc - XML document
        layerIndex - layer index
    • Method Detail

      • getLayerIndex

        public int getLayerIndex()
        Get the index of the layer that is currently exported.
        Returns:
        the index of the layer that is currently exported
      • getOutputStreamZip

        public OutputStream getOutputStreamZip​(String zipPath)
                                        throws IOException
        Create a file inside the zip archive.
        Parameters:
        zipPath - the path inside the zip archive, e.g. "layers/03/data.xml"
        Returns:
        the OutputStream you can write to. Never close the returned output stream, but make sure to flush buffers.
        Throws:
        IOException - if any I/O error occurs
      • isZip

        public boolean isZip()
        Check, if the session is exported as a zip archive.
        Returns:
        true, if the session is exported as a zip archive (.joz file extension). It will always return true, if one of the SessionLayerExporter returns true for the SessionLayerExporter.requiresZip() method. Otherwise, the user can decide in the file chooser dialog.