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 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...
 

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

◆ close()

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().

◆ doConversion()

void org.openoffice.xmerge.test.Driver.doConversion ( ) throws IllegalArgumentException
inlineprivate

◆ extractArg()

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().

◆ isZip()

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().

◆ main()

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

◆ parseCommandLine()

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

◆ showUsage()

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

◆ deviceFiles

final ArrayList<String> org.openoffice.xmerge.test.Driver.deviceFiles = new ArrayList<String>()
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().

◆ fromMime

String org.openoffice.xmerge.test.Driver.fromMime = null
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().

◆ mergeFile

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

◆ mimeTypes

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.

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

◆ toMime

String org.openoffice.xmerge.test.Driver.toMime = null
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().


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