org.pentaho.di.core
Class Const

java.lang.Object
  extended by org.pentaho.di.core.Const

public class Const
extends Object

This class is used to define a number of default values for various settings throughout Kettle. It also contains a number of static final methods to make your life easier.

Since:
07-05-2003
Author:
Matt

Field Summary
static int ARROW_WIDTH
          The default width of an arrow in the Graphical Views
static String CHEF_LOG_FILE
          The base name of the Chef logfile
static String CR
          CR: operating systems specific Carriage Return
static String DEFAULT_CURRENCY_SYMBOL
          The default currency symbol
static char DEFAULT_DECIMAL_SEPARATOR
          The default decimal separator . or ,
static char DEFAULT_GROUPING_SEPARATOR
          The default grouping separator , or .
static Locale DEFAULT_LOCALE
          The default locale for the kettle environment (system defined)
static String DEFAULT_NUMBER_FORMAT
          The default number format
static String DOSCR
          DOSCR: MS-DOS specific Carriage Return
static String EMPTY_STRING
          An empty ("") String.
static int ERROR
          UI-agnostic flag for warnings
static int FETCH_SIZE
          Fetch size in rows when querying a database
static String FILE_SEPARATOR
          What's the file systems file separator on this operating system?
static int FORM_MARGIN
          The horizontal and vertical margin of a dialog box.
static String GENERALIZED_DATE_TIME_FORMAT
          Generalized date/time format: Wherever dates are used, date and time values are organized from the most to the least significant.
static String GENERALIZED_DATE_TIME_FORMAT_MILLIS
           
static int INFO
          UI-agnostic flag for warnings
static String[] INTERNAL_JOB_VARIABLES
          All the internal job variables
static String[] INTERNAL_TRANS_VARIABLES
          All the internal job variables
static String INTERNAL_VARIABLE_CLUSTER_MASTER
          Is this transformation running clustered, on the master?
static String INTERNAL_VARIABLE_CLUSTER_SIZE
          The size of the cluster : number of slaves
static String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY
          The job filename directory
static String INTERNAL_VARIABLE_JOB_FILENAME_NAME
          The job filename name
static String INTERNAL_VARIABLE_JOB_NAME
          The job name
static String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY
          The job directory
static String INTERNAL_VARIABLE_KETTLE_BUILD_DATE
          The build date as an internal variable
static String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION
          The build version as an internal variable
static String INTERNAL_VARIABLE_KETTLE_VERSION
          The version number as an internal variable
static String INTERNAL_VARIABLE_PREFIX
          The prefix that all internal kettle variables should have
static String INTERNAL_VARIABLE_SLAVE_SERVER_NAME
          The slave transformation name
static String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER
          The slave transformation number
static String INTERNAL_VARIABLE_STEP_COPYNR
          The step copy nr
static String INTERNAL_VARIABLE_STEP_NAME
          The step name
static String INTERNAL_VARIABLE_STEP_PARTITION_ID
          The step partition ID
static String INTERNAL_VARIABLE_STEP_PARTITION_NR
          The step partition number
static String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT
          The size of the cluster : number of slaves
static String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER
          The slave transformation number
static String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY
          The transformation filename directory
static String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME
          The transformation filename name
static String INTERNAL_VARIABLE_TRANSFORMATION_NAME
          The transformation name
static String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY
          The transformation directory
static String JAVA_VERSION
          The Java runtime version
static String KETTLE_LOG_SIZE_LIMIT
          If you set this environment variable you can limit the log size of all transformations and jobs that don't have the "log size limit" property set in their respective properties.
static String KETTLE_PLUGIN_PACKAGES
          You can set this environment variable to make Kettle scan additional packages for annotated plugins.
static String KETTLE_PROPERTIES
          Name of the kettle parameters file
static int LENGTH
          Specifies the length (width) of fields in a number of pixels in dialog boxes.
static int MARGIN
          The margin between the different dialog components & widgets
static Date MAX_DATE
          Default maximum date range...
static int MAX_FILE_HIST
          Max nr. of files to remember
static int MAX_NR_HISTORY_LINES
          The default maximum for the nr of lines in the history views
static int MAX_NR_LOG_LINES
          The default maximum for the nr of lines in the GUI logs
static int MAX_UNDO
          The default undo level for Kettle
static int MAX_YEAR
          The default maximum year in a dimension date range
static String MENU_LOG_FILE
          The base name of the Menu logfile
static int MIDDLE_PCT
          The default percentage of the width of screen where we consider the middle of a dialog.
static Date MIN_DATE
          Default minimum date range...
static int MIN_YEAR
          The default minimum year in a dimension date range
static int NOTE_MARGIN
          The margin between the text of a note and its border.
static String NULL_BIGNUMBER
          Default string representing Null BigNumber values (empty)
static String NULL_BINARY
          Default string representing Null Binary values (empty)
static String NULL_BOOLEAN
          Default string representing Null Boolean values (empty)
static String NULL_DATE
          Default string representing Null Date values (empty)
static String NULL_GEOMETRY
          Default string representing Null Geometry values (empty)
static String NULL_INTEGER
          Default string representing Null Integer values (empty)
static String NULL_NONE
          Default string representing Null Undefined values (empty)
static String NULL_NUMBER
          Default string representing Null Number values (empty)
static String NULL_STRING
          Default string representing Null String values (empty)
static String PATH_SEPARATOR
          What's the path separator on this operating system?
static String PLUGIN_JOBENTRIES_DIRECTORY_PRIVATE
          Private directory containing external job entries plugins
static String PLUGIN_JOBENTRIES_DIRECTORY_PUBLIC
          Public directory containing external job entries plugins
static String PLUGIN_STEPS_DIRECTORY_PRIVATE
          Private directory containing external steps plugins
static String PLUGIN_STEPS_DIRECTORY_PUBLIC
          Public directory containing external steps plugins
static int RIGHT
          Specifies the number of pixels to the right we have to go in dialog boxes.
static int ROWS_IN_ROWSET
          Size of rowset: bigger = faster for large amounts of data
static int ROWS_UPDATE
          print update every ... lines
static int SHADOW_SIZE
          The default shadow size on the graphical view.
static int SORT_SIZE
          Sort size: how many rows do we sort in memory at once?
static String SPOON_LOG_FILE
          The base name of the Spoon logfile
static String STRING_JOB_DEFAULT_EXT
          The extension of a Kettle job XML file
static String[] STRING_JOB_FILTER_EXT
          The possible extensions a job XML file can have.
static String[] STRING_TRANS_AND_JOB_FILTER_EXT
          The possible extensions a transformation XML file can have.
static String STRING_TRANS_DEFAULT_EXT
          The extension of a Kettle transformation XML file
static String[] STRING_TRANS_FILTER_EXT
          The possible extensions a transformation XML file can have.
static int SYMBOLSIZE
          The size of relationship symbols
static int TIMEOUT_GET_MILLIS
          Sleep time waiting when buffer is empty
static int TIMEOUT_PUT_MILLIS
          Sleep time waiting when buffer is full
static String USER_HOME_DIRECTORY
          Path to the users home directory (keep this entry above references to getKettleDirectory())
static String VERSION
          Version number
static int WARNING
          UI-agnostic flag for warnings
static String XML_ENCODING
          Default we store our information in Unicode UTF-8 character set.
 
Constructor Summary
Const()
           
 
Method Summary
static Date addTimeToDate(Date input, String time, String DateFormat)
          Add time to an input date
static byte[] createByteArray(int size)
          Utility class for use in JavaScript to create a new byte array.
static String createFilename(String name)
          Create a valid filename using a name We remove all special characters, spaces, etc.
static String createFilename(String directory, String name, String extension)
           
static String createName(String filename)
           
static ClassLoader createNewClassLoader()
           
static int decodeTime(String s, String DateFormat)
           
static String filenameOnly(String sFullPath)
           Returns the pure filename of a filename with full path.
static String[] getConversionFormats()
           
static String[] getDateFormats()
          Returning the localized date conversion formats.
static String getDigitsOnly(String input)
          Return digits only.
static String[] getDistinctStrings(String[] strings)
          Sorts the array of Strings, determines the uniquely occurring strings.
static String[] getEmptyPaddedStrings()
          Create an array of Strings consisting of spaces.
static String getEnvironmentVariable(String variable, String deflt)
          Retrieves the content of an environment variable
static String getHostname()
          Determine the hostname of the machine Kettle is running on
static String getIPAddress()
          Determins the IP address of the machine Kettle is running on.
static String getIPAddress(String networkInterfaceName)
          Get the primary IP address tied to a network interface (excluding loop-back etc)
static String[] getJobFilterNames()
           
static String getKettleCartePasswordFile()
          Returns the path to the Kettle Carte password file in the home directory: $KETTLE_HOME/.kettle/kettle.pwd
static String getKettleDirectory()
          Determines the Kettle directory in the user's home directory.
static String getKettleLocalCartePasswordFile()
          Returns the path to the Kettle local (current directory) Carte password file: .
static String getKettleLocalRepositoriesFile()
          Returns the path to the Kettle local (current directory) repositories XML file.
static String getKettleUserRepositoriesFile()
          Returns the full path to the Kettle repositories XML file.
static String getMACAddress()
          Tries to determine the MAC address of the machine Kettle is running on.
static String[] getNumberFormats()
          Returning the localized number conversion formats.
static int getOccurenceString(String string, String searchFor)
          Get the number of occurances of searchFor in string.
static String getOS()
          determine the OS name
static int getPercentageFreeMemory()
          Return the percentage of free memory for this JVM.
static String getSharedObjectsFile()
          Determines the location of the shared objects file
static String getStackTracker(Throwable e)
          Returns a string of the stack trace of the specified exception
static String[] getTips()
          Returning the internationalized tips of the days.
static String[] getTransformationAndJobFilterNames()
           
static String[] getTransformationFilterNames()
           
static int indexOfString(String lookup, List<String> list)
          Search for a string in a list of strings and return the index.
static int indexOfString(String lookup, String[] array)
          Search for a string in an array of strings and return the index.
static int[] indexsOfFoundStrings(String[] lookup, String[] array)
          Search for strings in an array of strings and return the indexes.
static int[] indexsOfStrings(String[] lookup, String[] array)
          Search for strings in an array of strings and return the indexes.
static String initCap(String string)
          Sets the first character of each word in upper-case.
static boolean isEmpty(Object[] array)
          Check if the array supplied is empty.
static boolean isEmpty(String string)
          Check if the string supplied is empty.
static boolean isEmpty(String[] strings)
          Check if the string array supplied is empty.
static boolean isEmpty(StringBuffer string)
          Check if the stringBuffer supplied is empty.
static boolean isLinux()
           
static boolean isOSX()
           
static boolean isSpace(char c)
          Determines whether or not a character is considered a space.
static boolean isWindows()
           
static String ltrim(String source)
          Left trim: remove spaces to the left of a String.
static String maskXML(String content)
          Mask XML content.
static long nanoTime()
          Return the current time as nano-seconds.
static int nrSpacesAfter(String field)
          Count the number of spaces to the right of a text.
static int nrSpacesBefore(String field)
          Count the number of spaces to the left of a text.
static String NVL(String source, String def)
          Implements Oracle style NVL function
static boolean onlySpaces(String str)
          Checks whether or not a String consists only of spaces.
static String removeCR(String in)
          Remove CR / LF from String
static String removeCRLF(String in)
          Remove CR / LF from String
static String removeDigits(String input)
          Return non digits only.
static String removeLF(String in)
          Remove CR / LF from String
static String removeTAB(String in)
          Remove Horizontan Tab from String
static Date removeTimeFromDate(Date input)
          Remove time from a date.
static void repl(StringBuffer str, String code, String repl)
          Alternate faster version of string replace using a stringbuffer as input.
static String replace(String string, String repl, String with)
          Replace values in a String with another.
static String replEnv(String string)
          Deprecated. use StringUtil.environmentSubstitute(): handles both Windows and unix conventions
static String[] replEnv(String[] string)
          Deprecated. please use StringUtil.environmentSubstitute now.
static String rightPad(StringBuffer ret, int limit)
          Right pad a StringBuffer: adds spaces to a string until a certain length.
static String rightPad(String ret, int limit)
          Right pad a string: adds spaces to a string until a certain length.
static double round(double f, int places)
          rounds double f to any number of places after decimal point Does arithmetic using BigDecimal class to avoid integer overflow while rounding TODO: make the rounding itself optional in the Props for performance reasons.
static String rtrim(String source)
          Right trim: remove spaces to the right of a string
static String safeAppendDirectory(String dir, String file)
          implemented to help prevent errors in matching up pluggable LAF directories and paths/files eliminating malformed URLs - duplicate file separators or missing file separators.
static String[] sortStrings(String[] input)
          Sort the strings of an array in alphabetical order.
static String[] splitPath(String path, String separator)
          Convert strings separated by a string into an array of strings.
static String[] splitString(String string, char separator)
          Convert strings separated by a character into an array of strings.
static String[] splitString(String string, String separator)
          Convert strings separated by a string into an array of strings.
static Date toDate(String str, Date def)
          Convert a String into a date.
static double toDouble(String str, double def)
          Convert a String into a double.
static int toInt(String str, int def)
          Convert a String into an integer.
static long toLong(String str, long def)
          Convert a String into a long integer.
static String trim(String str)
          Trims a string: removes the leading and trailing spaces of a String.
static String trimToType(String string, int trimType)
          Return the input string trimmed as specified.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final String VERSION
Version number

See Also:
Constant Field Values

TIMEOUT_GET_MILLIS

public static final int TIMEOUT_GET_MILLIS
Sleep time waiting when buffer is empty

See Also:
Constant Field Values

TIMEOUT_PUT_MILLIS

public static final int TIMEOUT_PUT_MILLIS
Sleep time waiting when buffer is full

See Also:
Constant Field Values

ROWS_UPDATE

public static final int ROWS_UPDATE
print update every ... lines

See Also:
Constant Field Values

ROWS_IN_ROWSET

public static final int ROWS_IN_ROWSET
Size of rowset: bigger = faster for large amounts of data

See Also:
Constant Field Values

FETCH_SIZE

public static final int FETCH_SIZE
Fetch size in rows when querying a database

See Also:
Constant Field Values

SORT_SIZE

public static final int SORT_SIZE
Sort size: how many rows do we sort in memory at once?

See Also:
Constant Field Values

FILE_SEPARATOR

public static final String FILE_SEPARATOR
What's the file systems file separator on this operating system?


PATH_SEPARATOR

public static final String PATH_SEPARATOR
What's the path separator on this operating system?


CR

public static final String CR
CR: operating systems specific Carriage Return


DOSCR

public static final String DOSCR
DOSCR: MS-DOS specific Carriage Return

See Also:
Constant Field Values

EMPTY_STRING

public static final String EMPTY_STRING
An empty ("") String.

See Also:
Constant Field Values

JAVA_VERSION

public static final String JAVA_VERSION
The Java runtime version


USER_HOME_DIRECTORY

public static final String USER_HOME_DIRECTORY
Path to the users home directory (keep this entry above references to getKettleDirectory())


PLUGIN_STEPS_DIRECTORY_PUBLIC

public static final String PLUGIN_STEPS_DIRECTORY_PUBLIC
Public directory containing external steps plugins


PLUGIN_STEPS_DIRECTORY_PRIVATE

public static final String PLUGIN_STEPS_DIRECTORY_PRIVATE
Private directory containing external steps plugins


PLUGIN_JOBENTRIES_DIRECTORY_PUBLIC

public static final String PLUGIN_JOBENTRIES_DIRECTORY_PUBLIC
Public directory containing external job entries plugins


PLUGIN_JOBENTRIES_DIRECTORY_PRIVATE

public static final String PLUGIN_JOBENTRIES_DIRECTORY_PRIVATE
Private directory containing external job entries plugins


MIN_DATE

public static final Date MIN_DATE
Default minimum date range...


MAX_DATE

public static final Date MAX_DATE
Default maximum date range...


MIN_YEAR

public static final int MIN_YEAR
The default minimum year in a dimension date range

See Also:
Constant Field Values

MAX_YEAR

public static final int MAX_YEAR
The default maximum year in a dimension date range

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Specifies the number of pixels to the right we have to go in dialog boxes.

See Also:
Constant Field Values

LENGTH

public static final int LENGTH
Specifies the length (width) of fields in a number of pixels in dialog boxes.

See Also:
Constant Field Values

MARGIN

public static final int MARGIN
The margin between the different dialog components & widgets

See Also:
Constant Field Values

MIDDLE_PCT

public static final int MIDDLE_PCT
The default percentage of the width of screen where we consider the middle of a dialog.

See Also:
Constant Field Values

ARROW_WIDTH

public static final int ARROW_WIDTH
The default width of an arrow in the Graphical Views

See Also:
Constant Field Values

FORM_MARGIN

public static final int FORM_MARGIN
The horizontal and vertical margin of a dialog box.

See Also:
Constant Field Values

SHADOW_SIZE

public static final int SHADOW_SIZE
The default shadow size on the graphical view.

See Also:
Constant Field Values

SYMBOLSIZE

public static final int SYMBOLSIZE
The size of relationship symbols

See Also:
Constant Field Values

MAX_FILE_HIST

public static final int MAX_FILE_HIST
Max nr. of files to remember

See Also:
Constant Field Values

DEFAULT_LOCALE

public static final Locale DEFAULT_LOCALE
The default locale for the kettle environment (system defined)


DEFAULT_DECIMAL_SEPARATOR

public static final char DEFAULT_DECIMAL_SEPARATOR
The default decimal separator . or ,


DEFAULT_GROUPING_SEPARATOR

public static final char DEFAULT_GROUPING_SEPARATOR
The default grouping separator , or .


DEFAULT_CURRENCY_SYMBOL

public static final String DEFAULT_CURRENCY_SYMBOL
The default currency symbol


DEFAULT_NUMBER_FORMAT

public static final String DEFAULT_NUMBER_FORMAT
The default number format


NULL_STRING

public static final String NULL_STRING
Default string representing Null String values (empty)

See Also:
Constant Field Values

NULL_NUMBER

public static final String NULL_NUMBER
Default string representing Null Number values (empty)

See Also:
Constant Field Values

NULL_DATE

public static final String NULL_DATE
Default string representing Null Date values (empty)

See Also:
Constant Field Values

NULL_BIGNUMBER

public static final String NULL_BIGNUMBER
Default string representing Null BigNumber values (empty)

See Also:
Constant Field Values

NULL_BOOLEAN

public static final String NULL_BOOLEAN
Default string representing Null Boolean values (empty)

See Also:
Constant Field Values

NULL_INTEGER

public static final String NULL_INTEGER
Default string representing Null Integer values (empty)

See Also:
Constant Field Values

NULL_BINARY

public static final String NULL_BINARY
Default string representing Null Binary values (empty)

See Also:
Constant Field Values

NULL_GEOMETRY

public static final String NULL_GEOMETRY
Default string representing Null Geometry values (empty)

See Also:
Constant Field Values

NULL_NONE

public static final String NULL_NONE
Default string representing Null Undefined values (empty)

See Also:
Constant Field Values

CHEF_LOG_FILE

public static final String CHEF_LOG_FILE
The base name of the Chef logfile

See Also:
Constant Field Values

SPOON_LOG_FILE

public static final String SPOON_LOG_FILE
The base name of the Spoon logfile

See Also:
Constant Field Values

MENU_LOG_FILE

public static final String MENU_LOG_FILE
The base name of the Menu logfile

See Also:
Constant Field Values

GENERALIZED_DATE_TIME_FORMAT

public static final String GENERALIZED_DATE_TIME_FORMAT
Generalized date/time format: Wherever dates are used, date and time values are organized from the most to the least significant. see also method StringUtil.getFormattedDateTime()

See Also:
Constant Field Values

GENERALIZED_DATE_TIME_FORMAT_MILLIS

public static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS
See Also:
Constant Field Values

XML_ENCODING

public static final String XML_ENCODING
Default we store our information in Unicode UTF-8 character set.

See Also:
Constant Field Values

STRING_TRANS_AND_JOB_FILTER_EXT

public static final String[] STRING_TRANS_AND_JOB_FILTER_EXT
The possible extensions a transformation XML file can have.


STRING_TRANS_DEFAULT_EXT

public static final String STRING_TRANS_DEFAULT_EXT
The extension of a Kettle transformation XML file

See Also:
Constant Field Values

STRING_TRANS_FILTER_EXT

public static final String[] STRING_TRANS_FILTER_EXT
The possible extensions a transformation XML file can have.


STRING_JOB_DEFAULT_EXT

public static final String STRING_JOB_DEFAULT_EXT
The extension of a Kettle job XML file

See Also:
Constant Field Values

STRING_JOB_FILTER_EXT

public static final String[] STRING_JOB_FILTER_EXT
The possible extensions a job XML file can have.


KETTLE_PROPERTIES

public static final String KETTLE_PROPERTIES
Name of the kettle parameters file

See Also:
Constant Field Values

INTERNAL_VARIABLE_PREFIX

public static final String INTERNAL_VARIABLE_PREFIX
The prefix that all internal kettle variables should have

See Also:
Constant Field Values

INTERNAL_VARIABLE_KETTLE_VERSION

public static final String INTERNAL_VARIABLE_KETTLE_VERSION
The version number as an internal variable

See Also:
Constant Field Values

INTERNAL_VARIABLE_KETTLE_BUILD_VERSION

public static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION
The build version as an internal variable

See Also:
Constant Field Values

INTERNAL_VARIABLE_KETTLE_BUILD_DATE

public static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE
The build date as an internal variable

See Also:
Constant Field Values

INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY

public static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY
The job filename directory

See Also:
Constant Field Values

INTERNAL_VARIABLE_JOB_FILENAME_NAME

public static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME
The job filename name

See Also:
Constant Field Values

INTERNAL_VARIABLE_JOB_NAME

public static final String INTERNAL_VARIABLE_JOB_NAME
The job name

See Also:
Constant Field Values

INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY

public static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY
The job directory

See Also:
Constant Field Values

INTERNAL_TRANS_VARIABLES

public static final String[] INTERNAL_TRANS_VARIABLES
All the internal job variables


INTERNAL_JOB_VARIABLES

public static final String[] INTERNAL_JOB_VARIABLES
All the internal job variables


INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY

public static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY
The transformation filename directory

See Also:
Constant Field Values

INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME

public static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME
The transformation filename name

See Also:
Constant Field Values

INTERNAL_VARIABLE_TRANSFORMATION_NAME

public static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME
The transformation name

See Also:
Constant Field Values

INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY

public static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY
The transformation directory

See Also:
Constant Field Values

INTERNAL_VARIABLE_STEP_PARTITION_ID

public static final String INTERNAL_VARIABLE_STEP_PARTITION_ID
The step partition ID

See Also:
Constant Field Values

INTERNAL_VARIABLE_STEP_PARTITION_NR

public static final String INTERNAL_VARIABLE_STEP_PARTITION_NR
The step partition number

See Also:
Constant Field Values

INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER

public static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER
The slave transformation number

See Also:
Constant Field Values

INTERNAL_VARIABLE_SLAVE_SERVER_NAME

public static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME
The slave transformation name

See Also:
Constant Field Values

INTERNAL_VARIABLE_CLUSTER_SIZE

public static final String INTERNAL_VARIABLE_CLUSTER_SIZE
The size of the cluster : number of slaves

See Also:
Constant Field Values

INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER

public static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER
The slave transformation number

See Also:
Constant Field Values

INTERNAL_VARIABLE_CLUSTER_MASTER

public static final String INTERNAL_VARIABLE_CLUSTER_MASTER
Is this transformation running clustered, on the master?

See Also:
Constant Field Values

INTERNAL_VARIABLE_STEP_UNIQUE_COUNT

public static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT
The size of the cluster : number of slaves

See Also:
Constant Field Values

INTERNAL_VARIABLE_STEP_NAME

public static final String INTERNAL_VARIABLE_STEP_NAME
The step name

See Also:
Constant Field Values

INTERNAL_VARIABLE_STEP_COPYNR

public static final String INTERNAL_VARIABLE_STEP_COPYNR
The step copy nr

See Also:
Constant Field Values

MAX_NR_LOG_LINES

public static final int MAX_NR_LOG_LINES
The default maximum for the nr of lines in the GUI logs

See Also:
Constant Field Values

MAX_NR_HISTORY_LINES

public static final int MAX_NR_HISTORY_LINES
The default maximum for the nr of lines in the history views

See Also:
Constant Field Values

WARNING

public static final int WARNING
UI-agnostic flag for warnings

See Also:
Constant Field Values

ERROR

public static final int ERROR
UI-agnostic flag for warnings

See Also:
Constant Field Values

INFO

public static final int INFO
UI-agnostic flag for warnings

See Also:
Constant Field Values

NOTE_MARGIN

public static final int NOTE_MARGIN
The margin between the text of a note and its border.

See Also:
Constant Field Values

MAX_UNDO

public static final int MAX_UNDO
The default undo level for Kettle

See Also:
Constant Field Values

KETTLE_PLUGIN_PACKAGES

public static final String KETTLE_PLUGIN_PACKAGES
You can set this environment variable to make Kettle scan additional packages for annotated plugins. The packages are comma (,) delimited and the base specification is in the kettle-config.xml file

See Also:
Constant Field Values

KETTLE_LOG_SIZE_LIMIT

public static final String KETTLE_LOG_SIZE_LIMIT
If you set this environment variable you can limit the log size of all transformations and jobs that don't have the "log size limit" property set in their respective properties.

See Also:
Constant Field Values
Constructor Detail

Const

public Const()
Method Detail

round

public static final double round(double f,
                                 int places)
rounds double f to any number of places after decimal point Does arithmetic using BigDecimal class to avoid integer overflow while rounding TODO: make the rounding itself optional in the Props for performance reasons.

Parameters:
f - The value to round
places - The number of decimal places
Returns:
The rounded floating point value

toInt

public static final int toInt(String str,
                              int def)
Convert a String into an integer. If the conversion fails, assign a default value.

Parameters:
str - The String to convert to an integer
def - The default value
Returns:
The converted value or the default.

toLong

public static final long toLong(String str,
                                long def)
Convert a String into a long integer. If the conversion fails, assign a default value.

Parameters:
str - The String to convert to a long integer
def - The default value
Returns:
The converted value or the default.

toDouble

public static final double toDouble(String str,
                                    double def)
Convert a String into a double. If the conversion fails, assign a default value.

Parameters:
str - The String to convert to a double
def - The default value
Returns:
The converted value or the default.

toDate

public static final Date toDate(String str,
                                Date def)
Convert a String into a date. The date format is yyyy/MM/dd HH:mm:ss.SSS. If the conversion fails, assign a default value.

Parameters:
str - The String to convert into a Date
def - The default value
Returns:
The converted value or the default.

isSpace

public static final boolean isSpace(char c)
Determines whether or not a character is considered a space. A character is considered a space in Kettle if it is a space, a tab, a newline or a cariage return.

Parameters:
c - The character to verify if it is a space.
Returns:
true if the character is a space. false otherwise.

ltrim

public static String ltrim(String source)
Left trim: remove spaces to the left of a String.

Parameters:
str - The String to left trim
Returns:
The left trimmed String

rtrim

public static String rtrim(String source)
Right trim: remove spaces to the right of a string

Parameters:
str - The string to right trim
Returns:
The trimmed string.

trim

public static final String trim(String str)
Trims a string: removes the leading and trailing spaces of a String.

Parameters:
str - The string to trim
Returns:
The trimmed string.

rightPad

public static final String rightPad(String ret,
                                    int limit)
Right pad a string: adds spaces to a string until a certain length. If the length is smaller then the limit specified, the String is truncated.

Parameters:
ret - The string to pad
limit - The desired length of the padded string.
Returns:
The padded String.

rightPad

public static final String rightPad(StringBuffer ret,
                                    int limit)
Right pad a StringBuffer: adds spaces to a string until a certain length. If the length is smaller then the limit specified, the String is truncated.

Parameters:
ret - The StringBuffer to pad
limit - The desired length of the padded string.
Returns:
The padded String.

replace

public static final String replace(String string,
                                   String repl,
                                   String with)
Replace values in a String with another.

Parameters:
string - The original String.
repl - The text to replace
with - The new text bit
Returns:
The resulting string with the text pieces replaced.

repl

public static void repl(StringBuffer str,
                        String code,
                        String repl)
Alternate faster version of string replace using a stringbuffer as input.

Parameters:
str - The string where we want to replace in
code - The code to search for
repl - The replacement string for code

nrSpacesBefore

public static final int nrSpacesBefore(String field)
Count the number of spaces to the left of a text. (leading)

Parameters:
field - The text to examine
Returns:
The number of leading spaces found.

nrSpacesAfter

public static final int nrSpacesAfter(String field)
Count the number of spaces to the right of a text. (trailing)

Parameters:
field - The text to examine
Returns:
The number of trailing spaces found.

onlySpaces

public static final boolean onlySpaces(String str)
Checks whether or not a String consists only of spaces.

Parameters:
str - The string to check
Returns:
true if the string has nothing but spaces.

getOS

public static final String getOS()
determine the OS name

Returns:
The name of the OS

isWindows

public static final boolean isWindows()
Returns:
True if the OS is a Windows derivate.

isLinux

public static final boolean isLinux()
Returns:
True if the OS is a Linux derivate.

isOSX

public static final boolean isOSX()
Returns:
True if the OS is an OSX derivate.

getHostname

public static final String getHostname()
Determine the hostname of the machine Kettle is running on

Returns:
The hostname

getIPAddress

public static final String getIPAddress()
                                 throws Exception
Determins the IP address of the machine Kettle is running on.

Returns:
The IP address
Throws:
Exception

getIPAddress

public static final String getIPAddress(String networkInterfaceName)
                                 throws SocketException
Get the primary IP address tied to a network interface (excluding loop-back etc)

Parameters:
networkInterfaceName - the name of the network interface to interrogate
Returns:
null if the network interface or address wasn't found.
Throws:
SocketException - in case of a security or network error

getMACAddress

public static final String getMACAddress()
                                  throws Exception
Tries to determine the MAC address of the machine Kettle is running on.

Returns:
The MAC address.
Throws:
Exception

getKettleDirectory

public static final String getKettleDirectory()
Determines the Kettle directory in the user's home directory.

Returns:
The Kettle directory.

getSharedObjectsFile

public static final String getSharedObjectsFile()
Determines the location of the shared objects file

Returns:
the name of the shared objects file

getKettleLocalRepositoriesFile

public static final String getKettleLocalRepositoriesFile()
Returns the path to the Kettle local (current directory) repositories XML file.

Returns:
The local repositories file.

getKettleUserRepositoriesFile

public static final String getKettleUserRepositoriesFile()
Returns the full path to the Kettle repositories XML file.

Returns:
The Kettle repositories file.

getKettleLocalCartePasswordFile

public static final String getKettleLocalCartePasswordFile()
Returns the path to the Kettle local (current directory) Carte password file:

./pwd/kettle.pwd

Returns:
The local Carte password file.

getKettleCartePasswordFile

public static final String getKettleCartePasswordFile()
Returns the path to the Kettle Carte password file in the home directory:

$KETTLE_HOME/.kettle/kettle.pwd

Returns:
The Carte password file in the home directory.

getEnvironmentVariable

public static String getEnvironmentVariable(String variable,
                                            String deflt)
Retrieves the content of an environment variable

Parameters:
variable - The name of the environment variable
deflt - The default value in case no value was found
Returns:
The value of the environment variable or the value of deflt in case no variable was defined.

replEnv

public static final String replEnv(String string)
Deprecated. use StringUtil.environmentSubstitute(): handles both Windows and unix conventions

Replaces environment variables in a string. For example if you set KETTLE_HOME as an environment variable, you can use %%KETTLE_HOME%% in dialogs etc. to refer to this value. This procedures looks for %%...%% pairs and replaces them including the name of the environment variable with the actual value. In case the variable was not set, nothing is replaced!

Parameters:
string - The source string where text is going to be replaced.
Returns:
The expanded string.

replEnv

public static final String[] replEnv(String[] string)
Deprecated. please use StringUtil.environmentSubstitute now.

Replaces environment variables in an array of strings.

See also: replEnv(String string)

Parameters:
string - The array of strings that wants its variables to be replaced.
Returns:
the array with the environment variables replaced.

NVL

public static final String NVL(String source,
                               String def)
Implements Oracle style NVL function

Parameters:
source - The source argument
def - The default value in case source is null or the length of the string is 0
Returns:
source if source is not null, otherwise return def

indexOfString

public static final int indexOfString(String lookup,
                                      String[] array)
Search for a string in an array of strings and return the index.

Parameters:
lookup - The string to search for
array - The array of strings to look in
Returns:
The index of a search string in an array of strings. -1 if not found.

indexsOfStrings

public static final int[] indexsOfStrings(String[] lookup,
                                          String[] array)
Search for strings in an array of strings and return the indexes.

Parameters:
lookup - The strings to search for
array - The array of strings to look in
Returns:
The indexes of strings in an array of strings. -1 if not found.

indexsOfFoundStrings

public static final int[] indexsOfFoundStrings(String[] lookup,
                                               String[] array)
Search for strings in an array of strings and return the indexes. If a string is not found, the index is not returned.

Parameters:
lookup - The strings to search for
array - The array of strings to look in
Returns:
The indexes of strings in an array of strings. Only existing indexes are returned (no -1)

indexOfString

public static final int indexOfString(String lookup,
                                      List<String> list)
Search for a string in a list of strings and return the index.

Parameters:
lookup - The string to search for
list - The ArrayList of strings to look in
Returns:
The index of a search string in an array of strings. -1 if not found.

sortStrings

public static final String[] sortStrings(String[] input)
Sort the strings of an array in alphabetical order.

Parameters:
input - The array of strings to sort.
Returns:
The sorted array of strings.

splitString

public static final String[] splitString(String string,
                                         String separator)
Convert strings separated by a string into an array of strings.

Example: a;b;c;d ==> new String[] { a, b, c, d }

NOTE: this differs from String.split() in a way that the built-in method uses regular expressions and this one does not.

Parameters:
string - The string to split
separator - The separator used.
Returns:
the string split into an array of strings

splitString

public static final String[] splitString(String string,
                                         char separator)
Convert strings separated by a character into an array of strings.

Example: a;b;c;d == new String[] { a, b, c, d }

Parameters:
string - The string to split
separator - The separator used.
Returns:
the string split into an array of strings

splitPath

public static final String[] splitPath(String path,
                                       String separator)
Convert strings separated by a string into an array of strings.

Example /a/b/c --> new String[] { a, b, c }

Parameters:
path - The string to split
separator - The separator used.
Returns:
the string split into an array of strings

getConversionFormats

public static String[] getConversionFormats()
Returns:
An array of all default conversion formats, to be used in dialogs etc.

getDistinctStrings

public static final String[] getDistinctStrings(String[] strings)
Sorts the array of Strings, determines the uniquely occurring strings.

Parameters:
strings - the array that you want to do a distinct on
Returns:
a sorted array of uniquely occurring strings

getStackTracker

public static final String getStackTracker(Throwable e)
Returns a string of the stack trace of the specified exception


isEmpty

public static final boolean isEmpty(String string)
Check if the string supplied is empty. A String is empty when it is null or when the length is 0

Parameters:
string - The string to check
Returns:
true if the string supplied is empty

isEmpty

public static final boolean isEmpty(StringBuffer string)
Check if the stringBuffer supplied is empty. A StringBuffer is empty when it is null or when the length is 0

Parameters:
string - The stringBuffer to check
Returns:
true if the stringBuffer supplied is empty

isEmpty

public static final boolean isEmpty(String[] strings)
Check if the string array supplied is empty. A String array is empty when it is null or when the number of elements is 0

Parameters:
string - The string array to check
Returns:
true if the string array supplied is empty

isEmpty

public static final boolean isEmpty(Object[] array)
Check if the array supplied is empty. An array is empty when it is null or when the length is 0

Parameters:
array - The array to check
Returns:
true if the array supplied is empty

createNewClassLoader

public static final ClassLoader createNewClassLoader()
                                              throws KettleException
Returns:
a new ClassLoader
Throws:
KettleException

createByteArray

public static final byte[] createByteArray(int size)
Utility class for use in JavaScript to create a new byte array. This is surprisingly difficult to do in JavaScript.

Returns:
a new java byte array

initCap

public static final String initCap(String string)
Sets the first character of each word in upper-case.

Parameters:
string - The strings to convert to initcap
Returns:
the input string but with the first character of each word converted to upper-case.

createFilename

public static final String createFilename(String name)
Create a valid filename using a name We remove all special characters, spaces, etc.

Parameters:
name - The name to use as a base for the filename
Returns:
a valid filename

createFilename

public static final String createFilename(String directory,
                                          String name,
                                          String extension)

createName

public static final String createName(String filename)

filenameOnly

public static String filenameOnly(String sFullPath)

Returns the pure filename of a filename with full path. E.g. if passed parameter is /opt/tomcat/logs/catalina.out this method returns catalina.out. The method works with the Environment variable System.getProperty("file.separator"), so on linux/Unix it will check for the last occurrence of a frontslash, on windows for the last occurrence of a backslash.

To make this OS independent, the method could check for the last occurrence of a frontslash and backslash and use the higher value of both. Should work, since these characters aren't allowed in filenames on neither OS types (or said differently: Neither linux nor windows can carry frontslashes OR backslashes in filenames). Just a suggestion of an improvement ...

Parameters:
sFullPath -
Returns:

getTips

public static String[] getTips()
Returning the internationalized tips of the days. They get created once on first request.

Returns:

getDateFormats

public static String[] getDateFormats()
Returning the localized date conversion formats. They get created once on first request.

Returns:

getNumberFormats

public static String[] getNumberFormats()
Returning the localized number conversion formats. They get created once on first request.

Returns:

getTransformationAndJobFilterNames

public static String[] getTransformationAndJobFilterNames()

getTransformationFilterNames

public static String[] getTransformationFilterNames()

getJobFilterNames

public static String[] getJobFilterNames()

nanoTime

public static long nanoTime()
Return the current time as nano-seconds.

Returns:
time as nano-seconds.

trimToType

public static String trimToType(String string,
                                int trimType)
Return the input string trimmed as specified.

Parameters:
string - String to be trimmed
trimType - Type of trimming
Returns:
Trimmed string.

safeAppendDirectory

public static String safeAppendDirectory(String dir,
                                         String file)
implemented to help prevent errors in matching up pluggable LAF directories and paths/files eliminating malformed URLs - duplicate file separators or missing file separators.

Parameters:
dir -
file -
Returns:
concatenated string representing a file url

getEmptyPaddedStrings

public static String[] getEmptyPaddedStrings()
Create an array of Strings consisting of spaces. The index of a String in the array determines the number of spaces in that string.

Returns:
array of 'space' Strings.

getPercentageFreeMemory

public static final int getPercentageFreeMemory()
Return the percentage of free memory for this JVM.

Returns:
Percentage of free memory.

removeDigits

public static String removeDigits(String input)
Return non digits only.

Returns:
non digits in a string.

getDigitsOnly

public static String getDigitsOnly(String input)
Return digits only.

Returns:
digits in a string.

removeTimeFromDate

public static Date removeTimeFromDate(Date input)
Remove time from a date.

Returns:
a date without hour.

maskXML

public static String maskXML(String content)
Mask XML content. i.e. replace characters with &values;

Parameters:
content - content
Returns:
masked content

removeCRLF

public static String removeCRLF(String in)
Remove CR / LF from String

Parameters:
in - input
Returns:
cleaned string

removeCR

public static String removeCR(String in)
Remove CR / LF from String

Parameters:
in - input
Returns:
cleaned string

removeLF

public static String removeLF(String in)
Remove CR / LF from String

Parameters:
in - input
Returns:
cleaned string

removeTAB

public static String removeTAB(String in)
Remove Horizontan Tab from String

Parameters:
in - input
Returns:
cleaned string

addTimeToDate

public static Date addTimeToDate(Date input,
                                 String time,
                                 String DateFormat)
                          throws Exception
Add time to an input date

Parameters:
input - the date
time - the time to add (in string)
DateFormat - the time format
Returns:
date = input + time
Throws:
Exception

decodeTime

public static int decodeTime(String s,
                             String DateFormat)
                      throws Exception
Throws:
Exception

getOccurenceString

public static int getOccurenceString(String string,
                                     String searchFor)
Get the number of occurances of searchFor in string.

Parameters:
string - String to be searched
searchFor - to be counted string
Returns:
number of occurances