Package writer2latex.api
Interface BatchConverter
- All Known Implementing Classes:
BatchConverterBase
,BatchConverterImpl
public interface BatchConverter
This is an interface for a converter, which offers conversion of
all OpenDocument (or OpenOffice.org 1.x) documents in a directory
(and optionally subdirectories), creating index pages in a specific format.
Instances of this interface are created using the
ConverterFactory
-
Method Summary
Modifier and TypeMethodDescriptionvoid
convert
(File source, File target, boolean bRecurse, BatchHandler handler) Convert a directory using the givenConverter
(if none is given, all files will be ignored).createIndexFile
(String sHeading, IndexPageEntry[] entries) Create an index page with specific entriesGet the configuration interface for this batch convertervoid
readTemplate
(File file) Read a template to use as a base for the index pages.void
Read a template to use as a base for the index pages.void
setConverter
(Converter converter) Define aConverter
implementation to use for conversion of the individual documents.
-
Method Details
-
getConfig
Config getConfig()Get the configuration interface for this batch converter- Returns:
- the configuration
-
setConverter
Define aConverter
implementation to use for conversion of the individual documents. If no converter is given, theconvert
method cannot convert documents (but can still create index pages).- Parameters:
converter
- theConverter
to use
-
readTemplate
Read a template to use as a base for the index pages. The format of the template depends on theBatchConverter
implementation.- Parameters:
is
- anInputStream
from which to read the template- Throws:
IOException
- if some exception occurs while reading the template
-
readTemplate
Read a template to use as a base for the index pages. The format of the template depends on theBatchConverter
implementation.- Parameters:
file
- the file from which to read the template- Throws:
IOException
- if the file does not exist or some exception occurs while reading the template
-
createIndexFile
Create an index page with specific entries- Parameters:
sHeading
- a heading describing the index pageentries
- an array ofIndexPageEntry
objects (null entries are allowed, and will be ignored) describing the individual directories and documents
-
convert
Convert a directory using the givenConverter
(if none is given, all files will be ignored). This method fails silently if you haven't set a converter.- Parameters:
source
- aFile
representing the directory to converttarget
- aFile
representing the directory to contain the converted documentsbRecurse
- determines wether or not to recurse into subdirectorieshandler
- a BatchHandler
-