Class PEFFileSplitter

  • All Implemented Interfaces:
    ErrorHandler

    public class PEFFileSplitter
    extends Object
    implements ErrorHandler
    Splits a PEF-file into several single volume files. The main purpose is to interact with software that operates on one volume at a time.
    • Constructor Detail

      • PEFFileSplitter

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

      • split

        public boolean split​(File input,
                             File directory)
        Splits a PEF-file into several single volume PEF-files.
        Parameters:
        input - input PEF-file
        directory - output directory
        Returns:
        returns true if split was successful, false otherwise
        Throws:
        IllegalArgumentException - if input is not a file
      • split

        public boolean split​(InputStream is,
                             File directory)
        Splits the PEF-document provided as an input stream into several single volume PEF-files using the default file name pre- and postfix.
        Parameters:
        is - the input stream to the PEF-document
        directory - the output directory
        Returns:
        returns true if split was successful, false otherwise
      • split

        public boolean split​(InputStream is,
                             File directory,
                             String prefix,
                             String postfix)
        Splits the PEF-document provided as an input stream into several single volume PEF-files using the supplied file name pre- and postfix.
        Parameters:
        is - the input stream to the PEF-document
        directory - the output directory
        prefix - the prefix to use
        postfix - the postfix to use
        Returns:
        returns true if split was successful, false otherwise