1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.officeimporter.converter

File OfficeConverter.java

 

Code metrics

0
0
0
1
57
10
0
-
-
0
-

Classes

Class Line # Actions
OfficeConverter 33 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.officeimporter.converter;
21   
22    import java.io.InputStream;
23    import java.util.Map;
24   
25    import org.artofsolving.jodconverter.document.DocumentFormatRegistry;
26   
27    /**
28    * Interface used to convert documents between various office formats.
29    *
30    * @version $Id: aa7c74248bd92fa103e8ba93bd365dbce402d8af $
31    * @since 5.0M2
32    */
 
33    public interface OfficeConverter
34    {
35    /**
36    * Attempts to convert the input document identified by <b>inputStreams</b> and <b>inputFileName</b> arguments into
37    * the format identified by <b>outputFileName</b> argument.
38    *
39    * @param inputStreams input streams corresponding to the input document; it's possible that some document types
40    * (e.g. HTML) consists of more than one input stream corresponding to different artifacts embedded
41    * within document content
42    * @param inputFileName name of the main input file within <b>inputStreams</b> map; this argument is used to
43    * determine the format of the input document
44    * @param outputFileName name of the main output file; an entry corresponding to this name will be available in the
45    * results map if the conversion succeeds; This argument is used to determine the format of the output
46    * document
47    * @return map of file names to file contents resulting from the conversion
48    * @throws OfficeConverterException if an error occurs during the conversion
49    */
50    Map<String, byte[]> convert(Map<String, InputStream> inputStreams, String inputFileName, String outputFileName)
51    throws OfficeConverterException;
52   
53    /**
54    * @return the registry of document formats known by this converter
55    */
56    DocumentFormatRegistry getFormatRegistry();
57    }