public interface OfficeConverter
Modifier and Type | Method and Description |
---|---|
default OfficeConverterResult |
convertDocument(Map<String,InputStream> inputStreams,
String inputFileName,
String outputFileName)
Attempts to convert the input document identified by inputStreams and inputFileName arguments into
the format identified by outputFileName argument.
|
default OfficeDocumentFormat |
getDocumentFormat(String officeFileName)
Retrieve the office document format based on the given file name.
|
default boolean |
isConversionSupported(String inputMediaType,
String outputMediaType)
Use this method to check if the unidirectional conversion from a document format (input media type) to another
document format (output media type) is supported by this converter.
|
default boolean |
isMediaTypeSupported(String mediaType)
Checks if the office documents with the specified media type can be converted by this converter.
|
default boolean |
isPresentation(String officeFileName) |
@Unstable default OfficeConverterResult convertDocument(Map<String,InputStream> inputStreams, String inputFileName, String outputFileName) throws OfficeConverterException
Closeable.close()
to not keep remaining files.inputStreams
- input streams corresponding to the input document; it's possible that some document types
(e.g. HTML) consists of more than one input stream corresponding to different artifacts embedded
within document contentinputFileName
- name of the main input file within inputStreams map; this argument is used to
determine the format of the input documentoutputFileName
- name of the main output file; an entry corresponding to this name will be available in the
results map if the conversion succeeds; This argument is used to determine the format of the output
documentOfficeConverterException
- if an error occurs during the conversion@Unstable default boolean isPresentation(String officeFileName)
officeFileName
- the office file name to recognize@Unstable default OfficeDocumentFormat getDocumentFormat(String officeFileName)
officeFileName
- the name of an office document.@Unstable default boolean isMediaTypeSupported(String mediaType)
mediaType
- a media typetrue
if the specified media type is supported, false
otherwise@Unstable default boolean isConversionSupported(String inputMediaType, String outputMediaType)
inputMediaType
- the media type of the input documentoutputMediaType
- the media type of the output documenttrue
if a document can be converted from the input media type to the output media type,
false
otherwiseCopyright © 2004–2021 XWiki. All rights reserved.