org.rhq.helpers.perftest.support
Enum FileFormat

java.lang.Object
  extended by java.lang.Enum<FileFormat>
      extended by org.rhq.helpers.perftest.support.FileFormat
All Implemented Interfaces:
Serializable, Comparable<FileFormat>

public enum FileFormat
extends Enum<FileFormat>

Represents a file format to export/import database data to/from.

Author:
Lukas Krejci

Enum Constant Summary
CSV
          CSV file format.
XML
          XML file format.
ZIPPED_CSV
          Zipped CSV format.
ZIPPED_XML
          Zipped XML format.
 
Method Summary
abstract  Input getInput(InputStreamProvider provider)
          Returns an Input instance initialized with the specified InputStreamProvider.
abstract  Input getInput(String inputSpec)
          Returns an Input instance based on the input specification.
abstract  Output getOutput(String outputSpec)
          Returns an Output instance based on the output specification.
static FileFormat valueOf(String name)
          Returns the enum constant of this type with the specified name.
static FileFormat[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

XML

public static final FileFormat XML
XML file format. The input/output specification is understood to be a path to an input/output file.


CSV

public static final FileFormat CSV
CSV file format. The input/output specification is understood to be a path to a pre-existing directory that should contain the input/output files.


ZIPPED_XML

public static final FileFormat ZIPPED_XML
Zipped XML format. The input/output specification is understood to be a path to a zip file containing the xml file.


ZIPPED_CSV

public static final FileFormat ZIPPED_CSV
Zipped CSV format. The input/output specification is understood to be a path to a zip file containing the compressed directory with the CSV files.

Method Detail

values

public static FileFormat[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (FileFormat c : FileFormat.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static FileFormat valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getInput

public abstract Input getInput(String inputSpec)
                        throws IOException
Returns an Input instance based on the input specification. The format of the input specification is file format dependent.

Parameters:
inputSpec - the "location" of the input
Returns:
an Input instance able to process the inputSpec
Throws:
IOException

getInput

public abstract Input getInput(InputStreamProvider provider)
                        throws IOException
Returns an Input instance initialized with the specified InputStreamProvider. This enables more "low-level" usage than the getInput(String) method which assumes that the inputSpec can specify the input location without any other contextual information.

Parameters:
provider -
Returns:
Throws:
IOException
UnsupportedOperationException - if this file format doesn't support this type of initialization.

getOutput

public abstract Output getOutput(String outputSpec)
                          throws IOException
Returns an Output instance based on the output specification. The format of the output specification is file format dependent.

Parameters:
outputSpec - the "location" of the output
Returns:
an Output instance able to process the outputSpec
Throws:
IOException


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.