Package com.artofsolving.jodconverter.openoffice.connection

Examples of com.artofsolving.jodconverter.openoffice.connection.OpenOfficeException


        //property("InputStream", new InputStreamToXInputStreamAdapter(inputStream))
        loadProperties.put("InputStream", new ByteArrayToXInputStreamAdapter(IOUtils.toByteArray(inputStream)));
       
    XComponent document = desktop.loadComponentFromURL("private:stream", "_blank", 0, toPropertyValues(loadProperties));
        if (document == null) {
            throw new OpenOfficeException("conversion failed: input document is null after loading");
        }

    refreshDocument(document);
   
        Map/*<String,Object>*/ storeProperties = new HashMap();
View Full Code Here


        IOUtils.copy(outputFileStream, outputStream);
      } finally {
        IOUtils.closeQuietly(outputFileStream);
      }
    } catch (IOException ioException) {
      throw new OpenOfficeException("conversion failed", ioException);
    } finally {
      if (inputFile != null) {
        inputFile.delete();
      }
      if (outputFile != null) {
View Full Code Here

  private void loadAndExport(String inputUrl, Map/*<String,Object>*/ loadProperties, String outputUrl, Map/*<String,Object>*/ storeProperties) throws OpenOfficeException {
    XComponent document;
    try {
        document = loadDocument(inputUrl, loadProperties);
    } catch (ErrorCodeIOException errorCodeIOException) {
        throw new OpenOfficeException("conversion failed: could not load input document; OOo errorCode: " + errorCodeIOException.ErrCode, errorCodeIOException);
    } catch (Exception otherException) {
            throw new OpenOfficeException("conversion failed: could not load input document", otherException);
        }
    if (document == null) {
        throw new OpenOfficeException("conversion failed: could not load input document");
    }
   
    refreshDocument(document);
   
    try {
        storeDocument(document, outputUrl, storeProperties);
        } catch (ErrorCodeIOException errorCodeIOException) {
            throw new OpenOfficeException("conversion failed: could not save output document; OOo errorCode: " + errorCodeIOException.ErrCode, errorCodeIOException);
        } catch (Exception otherException) {
            throw new OpenOfficeException("conversion failed: could not save output document", otherException);
        }
  }
View Full Code Here

        loadAndExport(inputStream, inputFormat.getImportOptions(), outputStream, exportOptions);
      }
        } catch (OpenOfficeException openOfficeException) {
            throw openOfficeException;
    } catch (Throwable throwable) {
      throw new OpenOfficeException("conversion failed", throwable);
    }
  }
View Full Code Here

        //property("InputStream", new InputStreamToXInputStreamAdapter(inputStream))
        loadProperties.put("InputStream", new ByteArrayToXInputStreamAdapter(IOUtils.toByteArray(inputStream)));
       
    XComponent document = desktop.loadComponentFromURL("private:stream", "_blank", 0, toPropertyValues(loadProperties));
        if (document == null) {
            throw new OpenOfficeException("conversion failed: input document is null after loading");
        }

    refreshDocument(document);
   
        Map/*<String,Object>*/ storeProperties = new HashMap();
View Full Code Here

        IOUtils.copy(outputFileStream, outputStream);
      } finally {
        IOUtils.closeQuietly(outputFileStream);
      }
    } catch (IOException ioException) {
      throw new OpenOfficeException("conversion failed", ioException);
    } finally {
      if (inputFile != null) {
        inputFile.delete();
      }
      if (outputFile != null) {
View Full Code Here

      try {
        loadAndExport(inputUrl, outputUrl, exportProperties);
      } catch (Throwable throwable) {
        // difficult to provide finer grained error reporting here;
        // OOo seems to throw ErrorCodeIOException most of the time
        throw new OpenOfficeException("conversion failed", throwable);
      }
    }   
  }
View Full Code Here

    try {
      synchronized (openOfficeConnection) {
        loadAndExport(inputStream, outputStream, filterName, toPropertyValues(outputFormat.getExportOptions()));
      }
    } catch (Throwable throwable) {
      throw new OpenOfficeException("conversion failed", throwable);
    }
  }
View Full Code Here

TOP

Related Classes of com.artofsolving.jodconverter.openoffice.connection.OpenOfficeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.