LibreOffice Module xmerge (master)  1
Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
org.openoffice.xmerge.test.Driver Class Reference

This class is a command-line driver for the converter framework. More...

Collaboration diagram for org.openoffice.xmerge.test.Driver:
[legend]

Static Public Member Functions

static void main (String args[])
 Main. More...
 

Private Member Functions

void doConversion () throws IllegalArgumentException
 Gets a. 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
 
final ArrayList< String > deviceFiles = new ArrayList<String>()
 Command-line parameter. More...
 
final String mimeTypes []
 Command-line parameter shortcuts. More...
 

Detailed Description

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.

Member Function Documentation

static void org.openoffice.xmerge.test.Driver.close ( FileOutputStream  c)
inlinestaticprivate

Definition at line 103 of file Driver.java.

References Exception.

Referenced by org.openoffice.xmerge.test.Driver.doConversion().

void org.openoffice.xmerge.test.Driver.doConversion ( ) throws IllegalArgumentException
inlineprivate
String org.openoffice.xmerge.test.Driver.extractArg ( int  i,
String  args[] 
) throws IllegalArgumentException
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.

Parameters
iArgument index.
argsArray of command line arguments.
Returns
The argument with the specified index.
Exceptions
IllegalArgumentExceptionIf 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().

boolean org.openoffice.xmerge.test.Driver.isZip ( String  zipName)
inlineprivate

Simple validation for Office ZIP files.

Parameters
zipNameThe name of the ZIP file.
Returns
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().

static void org.openoffice.xmerge.test.Driver.main ( String  args[])
inlinestatic
void org.openoffice.xmerge.test.Driver.parseCommandLine ( String  args[]) throws IllegalArgumentException
inlineprivate

Parse command-line arguments.

Parameters
argsArray of command line arguments.
Exceptions
IllegalArgumentExceptionIf an argument is invalid.

Definition at line 222 of file Driver.java.

References args, equals(), org.openoffice.xmerge.test.Driver.extractArg(), i, org.openoffice.xmerge.test.Driver.isZip(), String, and System.

Referenced by org.openoffice.xmerge.test.Driver.main().

static void org.openoffice.xmerge.test.Driver.showUsage ( )
inlinestaticprivate

Display usage.

Definition at line 208 of file Driver.java.

References System.

Referenced by org.openoffice.xmerge.test.Driver.main().

Member Data Documentation

final ArrayList<String> org.openoffice.xmerge.test.Driver.deviceFiles = new ArrayList<String>()
private

Command-line parameter.

Definition at line 54 of file Driver.java.

String org.openoffice.xmerge.test.Driver.fromMime = null
private

Command-line parameter.

Definition at line 45 of file Driver.java.

String org.openoffice.xmerge.test.Driver.mergeFile = null
private

name.

Definition at line 51 of file Driver.java.

final String org.openoffice.xmerge.test.Driver.mimeTypes[]
private
Initial value:
= {
"sxc", "staroffice/sxc",
"sxw","staroffice/sxw"
}

Command-line parameter shortcuts.

Definition at line 57 of file Driver.java.

String org.openoffice.xmerge.test.Driver.toMime = null
private

Command-line parameter.

Definition at line 48 of file Driver.java.


The documentation for this class was generated from the following file: