Class JsonMetadataList


  • public class JsonMetadataList
    extends Object
    • Constructor Detail

      • JsonMetadataList

        public JsonMetadataList()
    • Method Detail

      • toJson

        public static void toJson​(List<Metadata> metadataList,
                                  Writer writer,
                                  boolean prettyPrint)
                           throws IOException
        Serializes a Metadata object to Json. This does not flush or close the writer.
        Parameters:
        metadataList - list of metadata to write
        writer - writer
        prettyPrint - whether or not to pretty print the output
        Throws:
        TikaException - if there is an IOException during writing
        IOException
      • toJson

        public static void toJson​(List<Metadata> metadataList,
                                  Writer writer)
                           throws IOException
        Serializes a Metadata object to Json. This does not flush or close the writer.
        Parameters:
        metadataList - list of metadata to write
        writer - writer
        Throws:
        TikaException - if there is an IOException during writing
        IOException
      • fromJson

        public static List<Metadata> fromJson​(Reader reader)
                                       throws IOException
        Read metadata from reader. This does not close the reader
        Parameters:
        reader -
        Returns:
        Metadata or null if nothing could be read from the reader
        Throws:
        IOException - in case of parse failure or IO failure with Reader
      • setPrettyPrinting

        public static void setPrettyPrinting​(boolean prettyPrint)