Class MetadataWriter

java.lang.Object
nl.knaw.dans.bagit.writer.MetadataWriter

public final class MetadataWriter extends Object
Responsible for writing out the bag Metadata to the filesystem
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • VERSION_0_95

      private static final Version VERSION_0_95
    • messages

      private static final ResourceBundle messages
  • Constructor Details

    • MetadataWriter

      private MetadataWriter()
  • Method Details

    • writeBagMetadata

      public static void writeBagMetadata(Metadata metadata, Version version, Path outputDir, Charset charsetName) throws IOException
      Write the bag-info.txt (or package-info.txt) file to the specified outputDir with specified encoding (charsetName)
      Parameters:
      metadata - the key value pair info in the bag-info.txt file
      version - the version of the bag you are writing
      outputDir - the root of the bag
      charsetName - the name of the encoding for the file
      Throws:
      IOException - if there was a problem writing a file