Class PEFFileMerger


  • public class PEFFileMerger
    extends 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.
    • Constructor Detail

      • PEFFileMerger

        public PEFFileMerger​(Predicate<URL> validator)
        Creates a new PEFFileMerger.
        Parameters:
        validator - a PEF-validator. A full validation is strongly recommended.
    • Method Detail

      • merge

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

        public boolean merge​(File[] files,
                             OutputStream os,
                             String identifier)
        Merges several PEF-files into one.
        Parameters:
        files - the files, in order
        os - the output file
        identifier - the identifier of the new publication
        Returns:
        true if merge was successful, false otherwise