Class OpenOfficeConverter
- java.lang.Object
-
- org.silverpeas.core.contribution.converter.openoffice.OpenOfficeConverter
-
- All Implemented Interfaces:
DocumentFormatConversion
- Direct Known Subclasses:
OpenOfficeHTMLConverter
,OpenOfficeODTConverter
,OpenOfficeToHTMLConverter
,OpenOfficeToPDFConverter
public abstract class OpenOfficeConverter extends Object implements DocumentFormatConversion
A document format converter using the OpenOffice API to perform its task. This class is the common one of all of the API document conversion implementation based on the OpenOffice API.
-
-
Constructor Summary
Constructors Constructor Description OpenOfficeConverter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description File
convert(File source, File destination, DocumentFormat outFormat, FilterOption... options)
Converts the specified document in the specified format.File
convert(File source, DocumentFormat inFormat, FilterOption... options)
Converts the specified document in the specified format.void
convert(InputStream source, DocumentFormat inFormat, OutputStream destination, DocumentFormat outFormat, FilterOption... options)
Converts the specified inputstream/format in the specified outputstream/format.abstract boolean
isDocumentSupported(File document)
Is the specified document in the format on which the converter works?-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.contribution.converter.DocumentFormatConversion
getSupportedFormats
-
-
-
-
Method Detail
-
isDocumentSupported
public abstract boolean isDocumentSupported(File document)
Is the specified document in the format on which the converter works?- Parameters:
document
- the document to check its format is supported.- Returns:
- true if the format of the document is supported by this converter, false otherwise.
-
convert
public File convert(File source, DocumentFormat inFormat, FilterOption... options)
Description copied from interface:DocumentFormatConversion
Converts the specified document in the specified format. The format should be supported by the converter. If an error occurs while converting the specified file, then a runtime exception DocumentFormatConversionException is thrown.- Specified by:
convert
in interfaceDocumentFormatConversion
- Parameters:
source
- the document to convert.inFormat
- the format into which the document has to be converted.options
- additional options such as "PageRange"- Returns:
- the file with the converted document.
-
convert
public File convert(File source, File destination, DocumentFormat outFormat, FilterOption... options)
Description copied from interface:DocumentFormatConversion
Converts the specified document in the specified format. The format should be supported by the converter. If an error occurs while converting the specified file, then a runtime exception DocumentFormatConversionException is thrown.- Specified by:
convert
in interfaceDocumentFormatConversion
- Parameters:
source
- the document to convert.destination
- the converted document.outFormat
- the format into which the document has to be converted.- Returns:
- the destination file.
-
convert
public void convert(InputStream source, DocumentFormat inFormat, OutputStream destination, DocumentFormat outFormat, FilterOption... options)
Description copied from interface:DocumentFormatConversion
Converts the specified inputstream/format in the specified outputstream/format.- Specified by:
convert
in interfaceDocumentFormatConversion
- Parameters:
source
- the source stream to convert.inFormat
- the format from which the document has to be converted.destination
- the converted stream.outFormat
- the format into which the document has to be converted.
-
-