Package org.daisy.braille.pef
Class PEFFileSplitter
java.lang.Object
org.daisy.braille.pef.PEFFileSplitter
- All Implemented Interfaces:
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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
error
(SAXParseException exception) void
fatalError
(SAXParseException exception) boolean
Splits a PEF-file into several single volume PEF-files.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.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.void
warning
(SAXParseException exception)
-
Field Details
-
PREFIX
Defines the default prefix for generated file names.- See Also:
-
POSTFIX
Defines the default postfix for generated file names.- See Also:
-
-
Constructor Details
-
PEFFileSplitter
public PEFFileSplitter()Creates a new PEFFileSplitter object.
-
-
Method Details
-
split
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:
IllegalArgumentException
- if input is not a file
-
split
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
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
- Specified by:
error
in interfaceErrorHandler
- Throws:
SAXException
-
fatalError
- Specified by:
fatalError
in interfaceErrorHandler
- Throws:
SAXException
-
warning
- Specified by:
warning
in interfaceErrorHandler
- Throws:
SAXException
-