Package org.daisy.braille.utils.pef
Class PEFFileMerger
- java.lang.Object
-
- org.daisy.braille.utils.pef.PEFFileMerger
-
public class PEFFileMerger extends Object
Merges several single volume PEF-files into one. Metadata is collected from the first file. The order of the files is determined by the file names. Two sorting algorithms are used:- standard, which sorts character by character in strict alphabetical order
- numeral grouping, which sorts groups of digits as numbers at the position in the string where they occur.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PEFFileMerger.SortType
Defines sorting types.
-
Constructor Summary
Constructors Constructor Description PEFFileMerger(Predicate<URL> validator)
Creates a new PEFFileMerger.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
merge(File[] files, OutputStream os, String identifier)
Merges several PEF-files into one.boolean
merge(File input, OutputStream os, String identifier, PEFFileMerger.SortType sortType)
Merges several PEF-files into one.
-
-
-
Method Detail
-
merge
public boolean merge(File input, OutputStream os, String identifier, PEFFileMerger.SortType sortType)
Merges several PEF-files into one.- Parameters:
input
- input directoryos
- output fileidentifier
- identifier of the new publicationsortType
- sort type- Returns:
- returns true if merge was successful, false otherwise
-
merge
public boolean merge(File[] files, OutputStream os, String identifier)
Merges several PEF-files into one.- Parameters:
files
- the files, in orderos
- the output fileidentifier
- the identifier of the new publication- Returns:
- true if merge was successful, false otherwise
-
-