Class FetchWriter

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

public final class FetchWriter extends Object
Responsible for writing out the list of FetchItem to the fetch.txt file on the filesystem
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • messages

      private static final ResourceBundle messages
  • Constructor Details

    • FetchWriter

      private FetchWriter()
  • Method Details

    • writeFetchFile

      public static void writeFetchFile(List<FetchItem> itemsToFetch, Path outputDir, Path bagitRootDir, Charset charsetName) throws IOException
      Write the fetch.txt file to the outputDir with the specified encoding (charsetName)
      Parameters:
      itemsToFetch - the list of FetchItems to write into the fetch.txt
      outputDir - the root of the bag
      bagitRootDir - the path to the root of the bag
      charsetName - the name of the encoding for the file
      Throws:
      IOException - if there was a problem writing a file
    • formatFetchLine

      private static String formatFetchLine(FetchItem fetchItem, Path bagitRootDir)