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.ErrorHandlerSplits 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 voiderror(org.xml.sax.SAXParseException exception)voidfatalError(org.xml.sax.SAXParseException exception)booleansplit(java.io.File input, java.io.File directory)Splits a PEF-file into several single volume PEF-files.booleansplit(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.booleansplit(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.voidwarning(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:
errorin 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:
fatalErrorin 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:
warningin interfaceorg.xml.sax.ErrorHandler- Throws:
org.xml.sax.SAXException
-
-