Class PEFFileSplitter

java.lang.Object
org.daisy.braille.pef.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.
Author:
Joel HÃ¥kansson
  • Field Details

  • Constructor Details

    • PEFFileSplitter

      public PEFFileSplitter()
      Creates a new PEFFileSplitter object.
  • Method Details

    • 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
    • error

      public void error(SAXParseException exception) throws SAXException
      Specified by:
      error in interface ErrorHandler
      Throws:
      SAXException
    • fatalError

      public void fatalError(SAXParseException exception) throws SAXException
      Specified by:
      fatalError in interface ErrorHandler
      Throws:
      SAXException
    • warning

      public void warning(SAXParseException exception) throws SAXException
      Specified by:
      warning in interface ErrorHandler
      Throws:
      SAXException