19 package org.openoffice.xmerge.util;
22 import java.io.FileOutputStream;
23 import java.io.FileInputStream;
24 import java.io.IOException;
26 import java.util.StringTokenizer;
27 import java.util.NoSuchElementException;
38 public static void main(String[] args) {
39 if (args.length != 4) {
47 asd.
Convert(args[0], args[1], args[2], args[3]);
54 private boolean Convert(String srcMime, String dstMime, String srcFile,
63 String strClassPath =
System.getProperty(
"java.class.path");
65 StringTokenizer st =
new StringTokenizer(strClassPath,
";");
68 while (st.hasMoreTokens()) {
71 if (s.endsWith(
"xmerge.jar")) {
72 ooClassDir = s.substring(0, s.indexOf(
"xmerge.jar"));
76 if (ooClassDir == null) {
88 if (srcMime.equals(
"staroffice/sxw") || srcMime.equals(
"application/x-pocket-word")) {
89 pluginJar =
new File(ooClassDir +
"pocketWord.jar");
91 if (srcMime.equals(
"staroffice/sxc") || srcMime.equals(
"application/x-pocket-excel")) {
92 pluginJar =
new File(ooClassDir +
"pexcel.jar");
111 FileInputStream fis = null;
112 FileOutputStream fos = null;
114 fis =
new FileInputStream(srcFile);
117 fos =
new FileOutputStream(dstFile);
128 }
catch (IOException e) {
130 }
catch (NullPointerException e) {
134 }
catch (NoSuchElementException e) {
Factory that provides access to.
Provides general purpose utilities.
Provides an interface for plug-in registration.
Convert getConverter(String mimeTypeIn, String mimeTypeOut)
Returns the.
exports com.sun.star. java
boolean Convert(String srcMime, String dstMime, String srcFile, String dstFile)
Manages the converter plug-ins that are currently active.
static void addPlugIn(ConverterInfo ci)
Adds a converter plug-in to the registry.
Iterator< Object > getDocumentEnumeration()
Gets an.
void write(OutputStream os)
Writes out the.
Provides interfaces for converting between two.
static void main(String[] args)
void addInputStream(String name, InputStream is)
Adds an.
ConvertData convert()
Convert the input specified in calls to the.
Iterator< ConverterInfo > getConverterInfoEnumeration()
Returns an.