Class DataExporterImpl

    • Constructor Detail

      • DataExporterImpl

        public DataExporterImpl​(org.slf4j.Logger log)
    • Method Detail

      • getResourceHeader

        protected String getResourceHeader​(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> connectionConfiguration)
                                    throws VersionRetrievalException,
                                           IOException
        Creates a small header to be applied to exported resource files. The header contains the database and Concept Manager application versions. Thus should help to avoid confusion about versioning of resources. The lines are prepended with the '#' character. Thus, reading applications should accept this character as a comment indicator.
        Parameters:
        connectionConfiguration - Connection configuration to retrieve the database version.
        Returns:
        A string representing the header.
        Throws:
        VersionRetrievalException - If the database version cannot be retrieved.
        IOException - If the application version cannot be read (it is stored in a auto-generated file).
      • decode

        protected InputStream decode​(InputStream inputData,
                                     org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> decodingConfig)
                              throws IOException
        Decodes data that has been encoded into a string. The decodingConfig determines which decodings are applied in which order. The following decodings are available:
        base64
        Base64 is an algorithm to encode arbitrary byte sequences into strings.
        gzip
        If the data contains a byte array that has been compressed with GZIP and then encoded into a string using base64, this decoding decompresses the byte array. Requires the base64 encoding to be applied before.
        json2bytearray
        While less performant than using base64, a byte array may also be encoded as a JSON array carrying the byte values.
        Parameters:
        inputData -
        decodingConfig -
        Returns:
        Throws:
        IOException