Package de.mhus.lib.core.io
Class SOfficeConnector
- java.lang.Object
-
- de.mhus.lib.core.MLog
-
- de.mhus.lib.core.io.SOfficeConnector
-
-
Field Summary
Fields Modifier and Type Field Description static StringSOFFICE_CONTENTstatic StringWORD_CONTENT
-
Constructor Summary
Constructors Constructor Description SOfficeConnector()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Stringcontent(File from)StringconvertTo(String format, String in, String outDir)Convert from in file format to 'format'.StringconvertToPdf(String in, String outDir)StringgetBinary()StringgetVersion()booleanisValid()static voidmain(String[] args)static voidreplace(File from, File to, StreamRewriter replacer)static voidreplace(File from, File to, StringPropertyReplacer replacer)voidsetBinary(String binary)StringtoString()
-
-
-
Field Detail
-
SOFFICE_CONTENT
public static final String SOFFICE_CONTENT
- See Also:
- Constant Field Values
-
WORD_CONTENT
public static final String WORD_CONTENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getBinary
public String getBinary()
-
setBinary
public void setBinary(String binary)
-
isValid
public boolean isValid()
-
getVersion
public String getVersion()
-
convertToPdf
public String convertToPdf(String in, String outDir) throws de.mhus.lib.errors.NotFoundException, IOException
- Throws:
de.mhus.lib.errors.NotFoundExceptionIOException
-
convertTo
public String convertTo(String format, String in, String outDir) throws de.mhus.lib.errors.NotFoundException, IOException
Convert from in file format to 'format'.- Parameters:
format- The resulting format and filter, see https://ask.libreoffice.org/en/question/2641/convert-to-command-line-parameter/in- Input fileoutDir- output directory or null for the same location as the input file- Returns:
- Path to the generated file
- Throws:
de.mhus.lib.errors.NotFoundExceptionIOException
-
main
public static void main(String[] args) throws de.mhus.lib.errors.NotFoundException, IOException
- Throws:
de.mhus.lib.errors.NotFoundExceptionIOException
-
replace
public static void replace(File from, File to, StringPropertyReplacer replacer) throws Exception
- Throws:
Exception
-
replace
public static void replace(File from, File to, StreamRewriter replacer) throws Exception
- Throws:
Exception
-
content
public static String content(File from) throws ZipException, IOException
- Throws:
ZipExceptionIOException
-
-