Class MetadataUtil


  • public class MetadataUtil
    extends Object
    • Constructor Detail

      • MetadataUtil

        public MetadataUtil()
    • Method Detail

      • openMetadataFileAsBinaryStream

        public static InputStream openMetadataFileAsBinaryStream​(String fileName)
        Opens a stream of the specified metadata file. This file is expected in the package the same as the MetadataConsts class. The file is in the ISO-8859-1 character table (aka Latin-1). A client should close it after use.
        Returns:
        a byte-stream of a text metadata file.
        See Also:
        MetadataConsts.ourMetadataCharset
      • loadMetadataFileAsStrings

        public static String[] loadMetadataFileAsStrings​(String fileName)
      • parseMetadataFileToSections

        public static Map<String,​List<String>> parseMetadataFileToSections​(String[] text)
        Parses the metadata file into sections. Each section is a word started without indentions, and all indented line are the content of the section.
        Parameters:
        text - file text as strings.
        Returns:
        map where key is a section caption and value is alist of inner lines (where head spaces are kept); the sections order is not supported but the order of lines inside a section is guaranteed to be the same as in the source file.
      • loadSchemaFromDatabase

        public static SchemaDef loadSchemaFromDatabase​(@NotNull
                                                       DBFunctions dbf)