LibreOffice Module xmerge (master) 1
|
This class is a command-line driver for the converter framework. More...
Static Public Member Functions | |
static void | main (String args[]) |
Main. More... | |
Private Member Functions | |
void | doConversion () throws IllegalArgumentException |
Gets a Convert object using the ConverterFactory and does the conversion using this object. More... | |
void | parseCommandLine (String args[]) throws IllegalArgumentException |
Parse command-line arguments. More... | |
String | extractArg (int i, String args[]) throws IllegalArgumentException |
Extract the next argument from the array, while checking to see that the array size is not exceeded. More... | |
boolean | isZip (String zipName) |
Simple validation for Office ZIP files. More... | |
Static Private Member Functions | |
static void | close (FileOutputStream c) |
static void | showUsage () |
Display usage. More... | |
Private Attributes | |
String | fromMime = null |
Command-line parameter. More... | |
String | toMime = null |
Command-line parameter. More... | |
String | mergeFile = null |
mergeFile name. More... | |
final ArrayList< String > | deviceFiles = new ArrayList<String>() |
Command-line parameter. More... | |
final String | mimeTypes [] |
Command-line parameter shortcuts. More... | |
This class is a command-line driver for the converter framework.
It is expected that this code will be later called by the device server. It does some basic validation of the command-line parameters.
Definition at line 42 of file Driver.java.
|
inlinestaticprivate |
Definition at line 103 of file Driver.java.
References Exception.
Referenced by org.openoffice.xmerge.test.Driver.doConversion().
|
inlineprivate |
Gets a Convert
object using the ConverterFactory
and does the conversion using this object.
IllegalArgumentException | If an argument is invalid. |
Definition at line 118 of file Driver.java.
References org.openoffice.xmerge.Convert.addInputStream(), org.openoffice.xmerge.test.Driver.close(), org.openoffice.xmerge.Convert.convert(), org.openoffice.xmerge.test.Driver.deviceFiles, Exception, File, org.openoffice.xmerge.test.Driver.fromMime, org.openoffice.xmerge.ConverterFactory.getConverter(), org.openoffice.xmerge.ConvertData.getDocumentEnumeration(), org.openoffice.xmerge.Convert.getDocumentMerger(), org.openoffice.xmerge.Document.getFileName(), org.openoffice.xmerge.Convert.getOfficeDocument(), org.openoffice.xmerge.DocumentMerger.merge(), org.openoffice.xmerge.test.Driver.mergeFile, String, System, org.openoffice.xmerge.test.Driver.toMime, and org.openoffice.xmerge.Document.write().
Referenced by org.openoffice.xmerge.test.Driver.main().
|
inlineprivate |
Extract the next argument from the array, while checking to see that the array size is not exceeded.
Throw a friendly error message in case the args[i+1]
is missing.
i | Argument index. |
args | Array of command line arguments. |
IllegalArgumentException | If an argument is invalid. |
Definition at line 278 of file Driver.java.
References args, i, and String.
Referenced by org.openoffice.xmerge.test.Driver.parseCommandLine().
|
inlineprivate |
Simple validation for Office ZIP files.
zipName | The name of the ZIP file. |
true
if zipName
is valid, false
otherwise. Definition at line 295 of file Driver.java.
References String.
Referenced by org.openoffice.xmerge.test.Driver.parseCommandLine().
|
inlinestatic |
Main.
args | The argument passed on the command line. |
Definition at line 67 of file Driver.java.
References org.openoffice.xmerge.util.registry.ConverterInfoMgr.addPlugIn(), args, org.openoffice.xmerge.test.Driver.doConversion(), ex, Exception, org.openoffice.xmerge.util.registry.ConverterInfoReader.getConverterInfoEnumeration(), org.openoffice.xmerge.test.ConverterInfoList.getJarFileEnum(), org.openoffice.xmerge.test.Driver.parseCommandLine(), org.openoffice.xmerge.test.Driver.showUsage(), String, and System.
|
inlineprivate |
Parse command-line arguments.
args | Array of command line arguments. |
IllegalArgumentException | If an argument is invalid. |
Definition at line 222 of file Driver.java.
References args, org.openoffice.xmerge.test.Driver.deviceFiles, org.openoffice.xmerge.test.Driver.extractArg(), org.openoffice.xmerge.test.Driver.fromMime, i, org.openoffice.xmerge.test.Driver.isZip(), org.openoffice.xmerge.test.Driver.mergeFile, org.openoffice.xmerge.test.Driver.mimeTypes, String, System, and org.openoffice.xmerge.test.Driver.toMime.
Referenced by org.openoffice.xmerge.test.Driver.main().
|
inlinestaticprivate |
Display usage.
Definition at line 208 of file Driver.java.
References System.
Referenced by org.openoffice.xmerge.test.Driver.main().
|
private |
Command-line parameter.
Definition at line 54 of file Driver.java.
Referenced by org.openoffice.xmerge.test.Driver.doConversion(), and org.openoffice.xmerge.test.Driver.parseCommandLine().
|
private |
Command-line parameter.
Definition at line 45 of file Driver.java.
Referenced by org.openoffice.xmerge.test.Driver.doConversion(), and org.openoffice.xmerge.test.Driver.parseCommandLine().
|
private |
mergeFile
name.
Definition at line 51 of file Driver.java.
Referenced by org.openoffice.xmerge.test.Driver.doConversion(), and org.openoffice.xmerge.test.Driver.parseCommandLine().
|
private |
Command-line parameter shortcuts.
Definition at line 57 of file Driver.java.
Referenced by org.openoffice.xmerge.test.Driver.parseCommandLine().
|
private |
Command-line parameter.
Definition at line 48 of file Driver.java.
Referenced by org.openoffice.xmerge.test.Driver.doConversion(), and org.openoffice.xmerge.test.Driver.parseCommandLine().