Class PEFFileMerger


  • public class PEFFileMerger
    extends java.lang.Object
    Merges several single volume PEF-files into one. Metadata is collected from the first file. The order of the files is determined by the file names. Two sorting algorithms are used:
    1. standard, which sorts character by character in strict alphabetical order
    2. numeral grouping, which sorts groups of digits as numbers at the position in the string where they occur.
    Author:
    Joel HÃ¥kansson
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  PEFFileMerger.SortType
      Defines sorting types
    • Constructor Summary

      Constructors 
      Constructor Description
      PEFFileMerger()
      Creates a new PEFFileMerger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean merge​(java.io.File input, java.io.OutputStream os, java.lang.String identifier, PEFFileMerger.SortType sort)
      Merges several PEF-files into one.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PEFFileMerger

        public PEFFileMerger()
        Creates a new PEFFileMerger
    • Method Detail

      • merge

        public boolean merge​(java.io.File input,
                             java.io.OutputStream os,
                             java.lang.String identifier,
                             PEFFileMerger.SortType sort)
        Merges several PEF-files into one.
        Parameters:
        input - input directory
        os - output file
        identifier - identifier of the new publication
        sort - sort type
        Returns:
        returns true if merge was successful, false otherwise