Package org.daisy.braille.pef
Class PEFFileSplitter
- java.lang.Object
-
- org.daisy.braille.pef.PEFFileSplitter
-
- All Implemented Interfaces:
org.xml.sax.ErrorHandler
public class PEFFileSplitter extends java.lang.Object implements org.xml.sax.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
-
-
Constructor Summary
Constructors Constructor Description PEFFileSplitter()
Creates a new PEFFileSplitter object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
error(org.xml.sax.SAXParseException exception)
void
fatalError(org.xml.sax.SAXParseException exception)
boolean
split(java.io.File input, java.io.File directory)
Splits a PEF-file into several single volume PEF-files.boolean
split(java.io.InputStream is, java.io.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.boolean
split(java.io.InputStream is, java.io.File directory, java.lang.String prefix, java.lang.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.void
warning(org.xml.sax.SAXParseException exception)
-
-
-
Field Detail
-
PREFIX
public static final java.lang.String PREFIX
Defines the default prefix for generated file names.- See Also:
- Constant Field Values
-
POSTFIX
public static final java.lang.String POSTFIX
Defines the default postfix for generated file names.- See Also:
- Constant Field Values
-
-
Method Detail
-
split
public boolean split(java.io.File input, java.io.File directory)
Splits a PEF-file into several single volume PEF-files.- Parameters:
input
- input PEF-filedirectory
- output directory- Returns:
- returns true if split was successful, false otherwise
- Throws:
java.lang.IllegalArgumentException
- if input is not a file
-
split
public boolean split(java.io.InputStream is, java.io.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-documentdirectory
- the output directory- Returns:
- returns true if split was successful, false otherwise
-
split
public boolean split(java.io.InputStream is, java.io.File directory, java.lang.String prefix, java.lang.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-documentdirectory
- the output directoryprefix
- the prefix to usepostfix
- the postfix to use- Returns:
- returns true if split was successful, false otherwise
-
error
public void error(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
- Specified by:
error
in interfaceorg.xml.sax.ErrorHandler
- Throws:
org.xml.sax.SAXException
-
fatalError
public void fatalError(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
- Specified by:
fatalError
in interfaceorg.xml.sax.ErrorHandler
- Throws:
org.xml.sax.SAXException
-
warning
public void warning(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
- Specified by:
warning
in interfaceorg.xml.sax.ErrorHandler
- Throws:
org.xml.sax.SAXException
-
-