target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testRound_Long() { assertEquals( 1L, Const.round( 1L, 0, BigDecimal.ROUND_UP ) ); assertEquals( 1L, Const.round( 1L, 0, BigDecimal.ROUND_DOWN ) ); assertEquals( 1L, Const.round( 1L, 0, BigDecimal.ROUND_CEILING ) ); assertEquals( 1L, Const.round( 1L, 0, BigDecimal.ROUND_FLOOR ) ); assertEquals( 1L, Const.round( 1L, 0, BigDecimal.ROUND_HALF_UP ) ); assertEquals( 1L, Const.round( 1L, 0, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( 1L, Const.round( 1L, 0, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( 1L, Const.round( 1L, 0, Const.ROUND_HALF_CEILING ) ); assertEquals( 2L, Const.round( 2L, 0, BigDecimal.ROUND_UP ) ); assertEquals( 2L, Const.round( 2L, 0, BigDecimal.ROUND_DOWN ) ); assertEquals( 2L, Const.round( 2L, 0, BigDecimal.ROUND_CEILING ) ); assertEquals( 2L, Const.round( 2L, 0, BigDecimal.ROUND_FLOOR ) ); assertEquals( 2L, Const.round( 2L, 0, BigDecimal.ROUND_HALF_UP ) ); assertEquals( 2L, Const.round( 2L, 0, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( 2L, Const.round( 2L, 0, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( 2L, Const.round( 2L, 0, Const.ROUND_HALF_CEILING ) ); assertEquals( -1L, Const.round( -1L, 0, BigDecimal.ROUND_UP ) ); assertEquals( -1L, Const.round( -1L, 0, BigDecimal.ROUND_DOWN ) ); assertEquals( -1L, Const.round( -1L, 0, BigDecimal.ROUND_CEILING ) ); assertEquals( -1L, Const.round( -1L, 0, BigDecimal.ROUND_FLOOR ) ); assertEquals( -1L, Const.round( -1L, 0, BigDecimal.ROUND_HALF_UP ) ); assertEquals( -1L, Const.round( -1L, 0, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( -1L, Const.round( -1L, 0, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( -1L, Const.round( -1L, 0, Const.ROUND_HALF_CEILING ) ); assertEquals( -2L, Const.round( -2L, 0, BigDecimal.ROUND_UP ) ); assertEquals( -2L, Const.round( -2L, 0, BigDecimal.ROUND_DOWN ) ); assertEquals( -2L, Const.round( -2L, 0, BigDecimal.ROUND_CEILING ) ); assertEquals( -2L, Const.round( -2L, 0, BigDecimal.ROUND_FLOOR ) ); assertEquals( -2L, Const.round( -2L, 0, BigDecimal.ROUND_HALF_UP ) ); assertEquals( -2L, Const.round( -2L, 0, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( -2L, Const.round( -2L, 0, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( -2L, Const.round( -2L, 0, Const.ROUND_HALF_CEILING ) ); assertEquals( 100L, Const.round( 100L, -2, BigDecimal.ROUND_UP ) ); assertEquals( 100L, Const.round( 100L, -2, BigDecimal.ROUND_DOWN ) ); assertEquals( 100L, Const.round( 100L, -2, BigDecimal.ROUND_CEILING ) ); assertEquals( 100L, Const.round( 100L, -2, BigDecimal.ROUND_FLOOR ) ); assertEquals( 100L, Const.round( 100L, -2, BigDecimal.ROUND_HALF_UP ) ); assertEquals( 100L, Const.round( 100L, -2, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( 100L, Const.round( 100L, -2, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( 100L, Const.round( 100L, -2, Const.ROUND_HALF_CEILING ) ); assertEquals( 200L, Const.round( 120L, -2, BigDecimal.ROUND_UP ) ); assertEquals( 100L, Const.round( 120L, -2, BigDecimal.ROUND_DOWN ) ); assertEquals( 200L, Const.round( 120L, -2, BigDecimal.ROUND_CEILING ) ); assertEquals( 100L, Const.round( 120L, -2, BigDecimal.ROUND_FLOOR ) ); assertEquals( 100L, Const.round( 120L, -2, BigDecimal.ROUND_HALF_UP ) ); assertEquals( 100L, Const.round( 120L, -2, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( 100L, Const.round( 120L, -2, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( 100L, Const.round( 120L, -2, Const.ROUND_HALF_CEILING ) ); assertEquals( 200L, Const.round( 150L, -2, BigDecimal.ROUND_UP ) ); assertEquals( 100L, Const.round( 150L, -2, BigDecimal.ROUND_DOWN ) ); assertEquals( 200L, Const.round( 150L, -2, BigDecimal.ROUND_CEILING ) ); assertEquals( 100L, Const.round( 150L, -2, BigDecimal.ROUND_FLOOR ) ); assertEquals( 200L, Const.round( 150L, -2, BigDecimal.ROUND_HALF_UP ) ); assertEquals( 100L, Const.round( 150L, -2, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( 200L, Const.round( 150L, -2, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( 200L, Const.round( 150L, -2, Const.ROUND_HALF_CEILING ) ); assertEquals( 200L, Const.round( 170L, -2, BigDecimal.ROUND_UP ) ); assertEquals( 100L, Const.round( 170L, -2, BigDecimal.ROUND_DOWN ) ); assertEquals( 200L, Const.round( 170L, -2, BigDecimal.ROUND_CEILING ) ); assertEquals( 100L, Const.round( 170L, -2, BigDecimal.ROUND_FLOOR ) ); assertEquals( 200L, Const.round( 170L, -2, BigDecimal.ROUND_HALF_UP ) ); assertEquals( 200L, Const.round( 170L, -2, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( 200L, Const.round( 170L, -2, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( 200L, Const.round( 170L, -2, Const.ROUND_HALF_CEILING ) ); assertEquals( 200L, Const.round( 200L, -2, BigDecimal.ROUND_UP ) ); assertEquals( 200L, Const.round( 200L, -2, BigDecimal.ROUND_DOWN ) ); assertEquals( 200L, Const.round( 200L, -2, BigDecimal.ROUND_CEILING ) ); assertEquals( 200L, Const.round( 200L, -2, BigDecimal.ROUND_FLOOR ) ); assertEquals( 200L, Const.round( 200L, -2, BigDecimal.ROUND_HALF_UP ) ); assertEquals( 200L, Const.round( 200L, -2, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( 200L, Const.round( 200L, -2, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( 200L, Const.round( 200L, -2, Const.ROUND_HALF_CEILING ) ); assertEquals( 300L, Const.round( 220L, -2, BigDecimal.ROUND_UP ) ); assertEquals( 200L, Const.round( 220L, -2, BigDecimal.ROUND_DOWN ) ); assertEquals( 300L, Const.round( 220L, -2, BigDecimal.ROUND_CEILING ) ); assertEquals( 200L, Const.round( 220L, -2, BigDecimal.ROUND_FLOOR ) ); assertEquals( 200L, Const.round( 220L, -2, BigDecimal.ROUND_HALF_UP ) ); assertEquals( 200L, Const.round( 220L, -2, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( 200L, Const.round( 220L, -2, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( 200L, Const.round( 220L, -2, Const.ROUND_HALF_CEILING ) ); assertEquals( 300L, Const.round( 250L, -2, BigDecimal.ROUND_UP ) ); assertEquals( 200L, Const.round( 250L, -2, BigDecimal.ROUND_DOWN ) ); assertEquals( 300L, Const.round( 250L, -2, BigDecimal.ROUND_CEILING ) ); assertEquals( 200L, Const.round( 250L, -2, BigDecimal.ROUND_FLOOR ) ); assertEquals( 300L, Const.round( 250L, -2, BigDecimal.ROUND_HALF_UP ) ); assertEquals( 200L, Const.round( 250L, -2, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( 200L, Const.round( 250L, -2, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( 300L, Const.round( 250L, -2, Const.ROUND_HALF_CEILING ) ); assertEquals( 300L, Const.round( 270L, -2, BigDecimal.ROUND_UP ) ); assertEquals( 200L, Const.round( 270L, -2, BigDecimal.ROUND_DOWN ) ); assertEquals( 300L, Const.round( 270L, -2, BigDecimal.ROUND_CEILING ) ); assertEquals( 200L, Const.round( 270L, -2, BigDecimal.ROUND_FLOOR ) ); assertEquals( 300L, Const.round( 270L, -2, BigDecimal.ROUND_HALF_UP ) ); assertEquals( 300L, Const.round( 270L, -2, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( 300L, Const.round( 270L, -2, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( 300L, Const.round( 270L, -2, Const.ROUND_HALF_CEILING ) ); assertEquals( -100L, Const.round( -100L, -2, BigDecimal.ROUND_UP ) ); assertEquals( -100L, Const.round( -100L, -2, BigDecimal.ROUND_DOWN ) ); assertEquals( -100L, Const.round( -100L, -2, BigDecimal.ROUND_CEILING ) ); assertEquals( -100L, Const.round( -100L, -2, BigDecimal.ROUND_FLOOR ) ); assertEquals( -100L, Const.round( -100L, -2, BigDecimal.ROUND_HALF_UP ) ); assertEquals( -100L, Const.round( -100L, -2, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( -100L, Const.round( -100L, -2, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( -100L, Const.round( -100L, -2, Const.ROUND_HALF_CEILING ) ); assertEquals( -200L, Const.round( -120L, -2, BigDecimal.ROUND_UP ) ); assertEquals( -100L, Const.round( -120L, -2, BigDecimal.ROUND_DOWN ) ); assertEquals( -100L, Const.round( -120L, -2, BigDecimal.ROUND_CEILING ) ); assertEquals( -200L, Const.round( -120L, -2, BigDecimal.ROUND_FLOOR ) ); assertEquals( -100L, Const.round( -120L, -2, BigDecimal.ROUND_HALF_UP ) ); assertEquals( -100L, Const.round( -120L, -2, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( -100L, Const.round( -120L, -2, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( -100L, Const.round( -120L, -2, Const.ROUND_HALF_CEILING ) ); assertEquals( -200L, Const.round( -150L, -2, BigDecimal.ROUND_UP ) ); assertEquals( -100L, Const.round( -150L, -2, BigDecimal.ROUND_DOWN ) ); assertEquals( -100L, Const.round( -150L, -2, BigDecimal.ROUND_CEILING ) ); assertEquals( -200L, Const.round( -150L, -2, BigDecimal.ROUND_FLOOR ) ); assertEquals( -200L, Const.round( -150L, -2, BigDecimal.ROUND_HALF_UP ) ); assertEquals( -100L, Const.round( -150L, -2, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( -200L, Const.round( -150L, -2, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( -100L, Const.round( -150L, -2, Const.ROUND_HALF_CEILING ) ); assertEquals( -200L, Const.round( -170L, -2, BigDecimal.ROUND_UP ) ); assertEquals( -100L, Const.round( -170L, -2, BigDecimal.ROUND_DOWN ) ); assertEquals( -100L, Const.round( -170L, -2, BigDecimal.ROUND_CEILING ) ); assertEquals( -200L, Const.round( -170L, -2, BigDecimal.ROUND_FLOOR ) ); assertEquals( -200L, Const.round( -170L, -2, BigDecimal.ROUND_HALF_UP ) ); assertEquals( -200L, Const.round( -170L, -2, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( -200L, Const.round( -170L, -2, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( -200L, Const.round( -170L, -2, Const.ROUND_HALF_CEILING ) ); assertEquals( -200L, Const.round( -200L, -2, BigDecimal.ROUND_UP ) ); assertEquals( -200L, Const.round( -200L, -2, BigDecimal.ROUND_DOWN ) ); assertEquals( -200L, Const.round( -200L, -2, BigDecimal.ROUND_CEILING ) ); assertEquals( -200L, Const.round( -200L, -2, BigDecimal.ROUND_FLOOR ) ); assertEquals( -200L, Const.round( -200L, -2, BigDecimal.ROUND_HALF_UP ) ); assertEquals( -200L, Const.round( -200L, -2, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( -200L, Const.round( -200L, -2, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( -200L, Const.round( -200L, -2, Const.ROUND_HALF_CEILING ) ); assertEquals( -300L, Const.round( -220L, -2, BigDecimal.ROUND_UP ) ); assertEquals( -200L, Const.round( -220L, -2, BigDecimal.ROUND_DOWN ) ); assertEquals( -200L, Const.round( -220L, -2, BigDecimal.ROUND_CEILING ) ); assertEquals( -300L, Const.round( -220L, -2, BigDecimal.ROUND_FLOOR ) ); assertEquals( -200L, Const.round( -220L, -2, BigDecimal.ROUND_HALF_UP ) ); assertEquals( -200L, Const.round( -220L, -2, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( -200L, Const.round( -220L, -2, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( -200L, Const.round( -220L, -2, Const.ROUND_HALF_CEILING ) ); assertEquals( -300L, Const.round( -250L, -2, BigDecimal.ROUND_UP ) ); assertEquals( -200L, Const.round( -250L, -2, BigDecimal.ROUND_DOWN ) ); assertEquals( -200L, Const.round( -250L, -2, BigDecimal.ROUND_CEILING ) ); assertEquals( -300L, Const.round( -250L, -2, BigDecimal.ROUND_FLOOR ) ); assertEquals( -300L, Const.round( -250L, -2, BigDecimal.ROUND_HALF_UP ) ); assertEquals( -200L, Const.round( -250L, -2, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( -200L, Const.round( -250L, -2, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( -200L, Const.round( -250L, -2, Const.ROUND_HALF_CEILING ) ); assertEquals( -300L, Const.round( -270L, -2, BigDecimal.ROUND_UP ) ); assertEquals( -200L, Const.round( -270L, -2, BigDecimal.ROUND_DOWN ) ); assertEquals( -200L, Const.round( -270L, -2, BigDecimal.ROUND_CEILING ) ); assertEquals( -300L, Const.round( -270L, -2, BigDecimal.ROUND_FLOOR ) ); assertEquals( -300L, Const.round( -270L, -2, BigDecimal.ROUND_HALF_UP ) ); assertEquals( -300L, Const.round( -270L, -2, BigDecimal.ROUND_HALF_DOWN ) ); assertEquals( -300L, Const.round( -270L, -2, BigDecimal.ROUND_HALF_EVEN ) ); assertEquals( -300L, Const.round( -270L, -2, Const.ROUND_HALF_CEILING ) ); }
public static double round( double f, int places ) { return round( f, places, java.math.BigDecimal.ROUND_HALF_EVEN ); }
Const { public static double round( double f, int places ) { return round( f, places, java.math.BigDecimal.ROUND_HALF_EVEN ); } }
Const { public static double round( double f, int places ) { return round( f, places, java.math.BigDecimal.ROUND_HALF_EVEN ); } }
Const { public static double round( double f, int places ) { return round( f, places, java.math.BigDecimal.ROUND_HALF_EVEN ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static double round( double f, int places ) { return round( f, places, java.math.BigDecimal.ROUND_HALF_EVEN ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testToInt() { assertEquals( 123, Const.toInt( "123", -12 ) ); assertEquals( -12, Const.toInt( "123f", -12 ) ); }
public static int toInt( String str, int def ) { int retval; try { retval = Integer.parseInt( str ); } catch ( Exception e ) { retval = def; } return retval; }
Const { public static int toInt( String str, int def ) { int retval; try { retval = Integer.parseInt( str ); } catch ( Exception e ) { retval = def; } return retval; } }
Const { public static int toInt( String str, int def ) { int retval; try { retval = Integer.parseInt( str ); } catch ( Exception e ) { retval = def; } return retval; } }
Const { public static int toInt( String str, int def ) { int retval; try { retval = Integer.parseInt( str ); } catch ( Exception e ) { retval = def; } return retval; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static int toInt( String str, int def ) { int retval; try { retval = Integer.parseInt( str ); } catch ( Exception e ) { retval = def; } return retval; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testToLong() { assertEquals( 1447252914241L, Const.toLong( "1447252914241", -12 ) ); assertEquals( -1447252914241L, Const.toLong( "1447252914241L", -1447252914241L ) ); }
public static long toLong( String str, long def ) { long retval; try { retval = Long.parseLong( str ); } catch ( Exception e ) { retval = def; } return retval; }
Const { public static long toLong( String str, long def ) { long retval; try { retval = Long.parseLong( str ); } catch ( Exception e ) { retval = def; } return retval; } }
Const { public static long toLong( String str, long def ) { long retval; try { retval = Long.parseLong( str ); } catch ( Exception e ) { retval = def; } return retval; } }
Const { public static long toLong( String str, long def ) { long retval; try { retval = Long.parseLong( str ); } catch ( Exception e ) { retval = def; } return retval; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static long toLong( String str, long def ) { long retval; try { retval = Long.parseLong( str ); } catch ( Exception e ) { retval = def; } return retval; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testToDouble() { Assert.assertEquals( 123.45, Const.toDouble( "123.45", -12.34 ), 1e-15 ); Assert.assertEquals( -12.34, Const.toDouble( "123asd", -12.34 ), 1e-15 ); }
public static double toDouble( String str, double def ) { double retval; try { retval = Double.parseDouble( str ); } catch ( Exception e ) { retval = def; } return retval; }
Const { public static double toDouble( String str, double def ) { double retval; try { retval = Double.parseDouble( str ); } catch ( Exception e ) { retval = def; } return retval; } }
Const { public static double toDouble( String str, double def ) { double retval; try { retval = Double.parseDouble( str ); } catch ( Exception e ) { retval = def; } return retval; } }
Const { public static double toDouble( String str, double def ) { double retval; try { retval = Double.parseDouble( str ); } catch ( Exception e ) { retval = def; } return retval; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static double toDouble( String str, double def ) { double retval; try { retval = Double.parseDouble( str ); } catch ( Exception e ) { retval = def; } return retval; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testRightPad() { final String s = "Pad me baby one more time"; assertEquals( " ", Const.rightPad( (String) null, 5 ) ); assertEquals( "Pad", Const.rightPad( s, 3 ) ); final StringBuffer sb = new StringBuffer( s ); assertEquals( s + " ", Const.rightPad( sb, 28 ) ); assertEquals( "Pad me baby", Const.rightPad( sb, 11 ) ); final StringBuilder sb2 = new StringBuilder( s ); assertEquals( s + " ", Const.rightPad( sb2, 28 ) ); assertEquals( "Pad me baby", Const.rightPad( sb2, 11 ) ); }
public static String rightPad( String ret, int limit ) { if ( ret == null ) { return rightPad( new StringBuilder(), limit ); } else { return rightPad( new StringBuilder( ret ), limit ); } }
Const { public static String rightPad( String ret, int limit ) { if ( ret == null ) { return rightPad( new StringBuilder(), limit ); } else { return rightPad( new StringBuilder( ret ), limit ); } } }
Const { public static String rightPad( String ret, int limit ) { if ( ret == null ) { return rightPad( new StringBuilder(), limit ); } else { return rightPad( new StringBuilder( ret ), limit ); } } }
Const { public static String rightPad( String ret, int limit ) { if ( ret == null ) { return rightPad( new StringBuilder(), limit ); } else { return rightPad( new StringBuilder( ret ), limit ); } } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String rightPad( String ret, int limit ) { if ( ret == null ) { return rightPad( new StringBuilder(), limit ); } else { return rightPad( new StringBuilder( ret ), limit ); } } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void transConfigItemsNoNameSpecified() throws Exception { TransMeta meta = new TransMeta(); Transformation trans = TransMetaConverter.convert( meta ); assertThat( trans.getConfig().get( TransMetaConverter.TRANS_META_NAME_CONF_KEY ), is( TransMetaConverter.TRANS_DEFAULT_NAME ) ); assertThat( (String) trans.getConfig().get( TransMetaConverter.TRANS_META_CONF_KEY ), startsWith( "<transformation>" ) ); }
public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); static final String TRANS_META_CONF_KEY; static final String TRANS_META_NAME_CONF_KEY; static final String SUB_TRANSFORMATIONS_KEY; static final String STEP_META_CONF_KEY; static final String TRANS_DEFAULT_NAME; }
@Test public void testReplace() { final String source = "A journey of a thousand miles never begins"; assertEquals( "A journey of a thousand miles begins with a single step", Const.replace( source, "never begins", "begins with a single step" ) ); assertEquals( source, Const.replace( source, "evil", "good" ) ); assertEquals( "short", Const.replace( "short", "long pattern", "replacement" ) ); assertEquals( "", Const.replace( "", "anything", "something" ) ); assertEquals( null, Const.replace( null, "test", "junk" ) ); assertEquals( null, Const.replace( "test", null, "junk" ) ); assertEquals( null, Const.replace( "test", "junk", null ) ); }
public static String replace( String string, String repl, String with ) { if ( string != null && repl != null && with != null ) { return string.replaceAll( Pattern.quote( repl ), Matcher.quoteReplacement( with ) ); } else { return null; } }
Const { public static String replace( String string, String repl, String with ) { if ( string != null && repl != null && with != null ) { return string.replaceAll( Pattern.quote( repl ), Matcher.quoteReplacement( with ) ); } else { return null; } } }
Const { public static String replace( String string, String repl, String with ) { if ( string != null && repl != null && with != null ) { return string.replaceAll( Pattern.quote( repl ), Matcher.quoteReplacement( with ) ); } else { return null; } } }
Const { public static String replace( String string, String repl, String with ) { if ( string != null && repl != null && with != null ) { return string.replaceAll( Pattern.quote( repl ), Matcher.quoteReplacement( with ) ); } else { return null; } } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String replace( String string, String repl, String with ) { if ( string != null && repl != null && with != null ) { return string.replaceAll( Pattern.quote( repl ), Matcher.quoteReplacement( with ) ); } else { return null; } } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testRepl() { String source = "A journey of a thousand miles never begins"; StringBuffer sb = new StringBuffer( source ); Const.repl( sb, "never begins", "begins with a single step" ); assertEquals( "A journey of a thousand miles begins with a single step", sb.toString() ); sb = new StringBuffer( source ); Const.repl( sb, "evil", "good" ); assertEquals( source, sb.toString() ); sb = new StringBuffer( "short" ); Const.repl( sb, "long pattern", "replacement" ); assertEquals( "short", sb.toString() ); sb = new StringBuffer( "" ); Const.repl( sb, "anything", "something" ); assertEquals( "", sb.toString() ); sb = new StringBuffer( "Replace what looks like a regex '[a-z1-3*+]' with '$1'" ); Const.repl( sb, "[a-z1-3*+]", "$1" ); assertEquals( "Replace what looks like a regex '$1' with '$1'", sb.toString() ); StringBuilder sb2 = new StringBuilder( source ); Const.repl( sb2, "never begins", "begins with a single step" ); assertEquals( "A journey of a thousand miles begins with a single step", sb2.toString() ); sb2 = new StringBuilder( source ); Const.repl( sb2, "evil", "good" ); assertEquals( source, sb2.toString() ); sb2 = new StringBuilder( "short" ); Const.repl( sb2, "long pattern", "replacement" ); assertEquals( "short", sb2.toString() ); sb2 = new StringBuilder( "" ); Const.repl( sb2, "anything", "something" ); assertEquals( "", sb2.toString() ); sb2 = new StringBuilder( "Replace what looks like a regex '[a-z1-3*+]' with '$1'" ); Const.repl( sb2, "[a-z1-3*+]", "$1" ); assertEquals( "Replace what looks like a regex '$1' with '$1'", sb2.toString() ); sb2 = new StringBuilder( "JUNK" ); Const.repl( sb2, null, "wibble" ); assertEquals( "JUNK", sb2.toString() ); Const.repl( sb2, "JUNK", null ); }
public static void repl( StringBuffer str, String code, String repl ) { if ( ( code == null ) || ( repl == null ) || ( code.length() == 0 ) || ( repl.length() == 0 ) || ( str == null ) || ( str.length() == 0 ) ) { return; } String aString = str.toString(); str.setLength( 0 ); str.append( aString.replaceAll( Pattern.quote( code ), Matcher.quoteReplacement( repl ) ) ); }
Const { public static void repl( StringBuffer str, String code, String repl ) { if ( ( code == null ) || ( repl == null ) || ( code.length() == 0 ) || ( repl.length() == 0 ) || ( str == null ) || ( str.length() == 0 ) ) { return; } String aString = str.toString(); str.setLength( 0 ); str.append( aString.replaceAll( Pattern.quote( code ), Matcher.quoteReplacement( repl ) ) ); } }
Const { public static void repl( StringBuffer str, String code, String repl ) { if ( ( code == null ) || ( repl == null ) || ( code.length() == 0 ) || ( repl.length() == 0 ) || ( str == null ) || ( str.length() == 0 ) ) { return; } String aString = str.toString(); str.setLength( 0 ); str.append( aString.replaceAll( Pattern.quote( code ), Matcher.quoteReplacement( repl ) ) ); } }
Const { public static void repl( StringBuffer str, String code, String repl ) { if ( ( code == null ) || ( repl == null ) || ( code.length() == 0 ) || ( repl.length() == 0 ) || ( str == null ) || ( str.length() == 0 ) ) { return; } String aString = str.toString(); str.setLength( 0 ); str.append( aString.replaceAll( Pattern.quote( code ), Matcher.quoteReplacement( repl ) ) ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static void repl( StringBuffer str, String code, String repl ) { if ( ( code == null ) || ( repl == null ) || ( code.length() == 0 ) || ( repl.length() == 0 ) || ( str == null ) || ( str.length() == 0 ) ) { return; } String aString = str.toString(); str.setLength( 0 ); str.append( aString.replaceAll( Pattern.quote( code ), Matcher.quoteReplacement( repl ) ) ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetOS() { final String key = "os.name"; final String os = System.getProperty( key ); System.setProperty( key, "BeOS" ); assertEquals( "BeOS", Const.getOS() ); System.setProperty( key, os ); }
public static String getOS() { return System.getProperty( "os.name" ); }
Const { public static String getOS() { return System.getProperty( "os.name" ); } }
Const { public static String getOS() { return System.getProperty( "os.name" ); } }
Const { public static String getOS() { return System.getProperty( "os.name" ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String getOS() { return System.getProperty( "os.name" ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testQuoteCharByOS() { assertEquals( SystemUtils.IS_OS_WINDOWS ? "\"" : "'", Const.getQuoteCharByOS() ); }
public static String getQuoteCharByOS() { if ( isWindows() ) { return "\""; } else { return "'"; } }
Const { public static String getQuoteCharByOS() { if ( isWindows() ) { return "\""; } else { return "'"; } } }
Const { public static String getQuoteCharByOS() { if ( isWindows() ) { return "\""; } else { return "'"; } } }
Const { public static String getQuoteCharByOS() { if ( isWindows() ) { return "\""; } else { return "'"; } } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String getQuoteCharByOS() { if ( isWindows() ) { return "\""; } else { return "'"; } } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testIsWindows() { assertEquals( SystemUtils.IS_OS_WINDOWS, Const.isWindows() ); }
public static boolean isWindows() { return getOS().startsWith( "Windows" ); }
Const { public static boolean isWindows() { return getOS().startsWith( "Windows" ); } }
Const { public static boolean isWindows() { return getOS().startsWith( "Windows" ); } }
Const { public static boolean isWindows() { return getOS().startsWith( "Windows" ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static boolean isWindows() { return getOS().startsWith( "Windows" ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testIsLinux() { assertEquals( SystemUtils.IS_OS_LINUX, Const.isLinux() ); }
public static boolean isLinux() { return getOS().startsWith( "Linux" ); }
Const { public static boolean isLinux() { return getOS().startsWith( "Linux" ); } }
Const { public static boolean isLinux() { return getOS().startsWith( "Linux" ); } }
Const { public static boolean isLinux() { return getOS().startsWith( "Linux" ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static boolean isLinux() { return getOS().startsWith( "Linux" ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testIsOSX() { assertEquals( SystemUtils.IS_OS_MAC_OSX, Const.isOSX() ); }
public static boolean isOSX() { return getOS().toUpperCase().contains( "OS X" ); }
Const { public static boolean isOSX() { return getOS().toUpperCase().contains( "OS X" ); } }
Const { public static boolean isOSX() { return getOS().toUpperCase().contains( "OS X" ); } }
Const { public static boolean isOSX() { return getOS().toUpperCase().contains( "OS X" ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static boolean isOSX() { return getOS().toUpperCase().contains( "OS X" ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testIsKDE() { final String kdeVersion = System.getProperty( "KDE_SESSION_VERSION" ); assertEquals( kdeVersion != null && !kdeVersion.isEmpty(), Const.isKDE() ); }
public static boolean isKDE() { return StringUtils.isNotBlank( System.getenv( "KDE_SESSION_VERSION" ) ); }
Const { public static boolean isKDE() { return StringUtils.isNotBlank( System.getenv( "KDE_SESSION_VERSION" ) ); } }
Const { public static boolean isKDE() { return StringUtils.isNotBlank( System.getenv( "KDE_SESSION_VERSION" ) ); } }
Const { public static boolean isKDE() { return StringUtils.isNotBlank( System.getenv( "KDE_SESSION_VERSION" ) ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static boolean isKDE() { return StringUtils.isNotBlank( System.getenv( "KDE_SESSION_VERSION" ) ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetHostName() { assertFalse( Const.getHostname().isEmpty() ); }
public static String getHostname() { if ( cachedHostname != null ) { return cachedHostname; } String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { cachedHostname = systemHostname; return systemHostname; } String lastHostname = "localhost"; try { Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); while ( en.hasMoreElements() ) { NetworkInterface nwi = en.nextElement(); Enumeration<InetAddress> ip = nwi.getInetAddresses(); while ( ip.hasMoreElements() ) { InetAddress in = ip.nextElement(); lastHostname = in.getHostName(); if ( !lastHostname.equalsIgnoreCase( "localhost" ) && !( lastHostname.indexOf( ':' ) >= 0 ) ) { break; } } } } catch ( SocketException e ) { } cachedHostname = lastHostname; return lastHostname; }
Const { public static String getHostname() { if ( cachedHostname != null ) { return cachedHostname; } String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { cachedHostname = systemHostname; return systemHostname; } String lastHostname = "localhost"; try { Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); while ( en.hasMoreElements() ) { NetworkInterface nwi = en.nextElement(); Enumeration<InetAddress> ip = nwi.getInetAddresses(); while ( ip.hasMoreElements() ) { InetAddress in = ip.nextElement(); lastHostname = in.getHostName(); if ( !lastHostname.equalsIgnoreCase( "localhost" ) && !( lastHostname.indexOf( ':' ) >= 0 ) ) { break; } } } } catch ( SocketException e ) { } cachedHostname = lastHostname; return lastHostname; } }
Const { public static String getHostname() { if ( cachedHostname != null ) { return cachedHostname; } String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { cachedHostname = systemHostname; return systemHostname; } String lastHostname = "localhost"; try { Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); while ( en.hasMoreElements() ) { NetworkInterface nwi = en.nextElement(); Enumeration<InetAddress> ip = nwi.getInetAddresses(); while ( ip.hasMoreElements() ) { InetAddress in = ip.nextElement(); lastHostname = in.getHostName(); if ( !lastHostname.equalsIgnoreCase( "localhost" ) && !( lastHostname.indexOf( ':' ) >= 0 ) ) { break; } } } } catch ( SocketException e ) { } cachedHostname = lastHostname; return lastHostname; } }
Const { public static String getHostname() { if ( cachedHostname != null ) { return cachedHostname; } String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { cachedHostname = systemHostname; return systemHostname; } String lastHostname = "localhost"; try { Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); while ( en.hasMoreElements() ) { NetworkInterface nwi = en.nextElement(); Enumeration<InetAddress> ip = nwi.getInetAddresses(); while ( ip.hasMoreElements() ) { InetAddress in = ip.nextElement(); lastHostname = in.getHostName(); if ( !lastHostname.equalsIgnoreCase( "localhost" ) && !( lastHostname.indexOf( ':' ) >= 0 ) ) { break; } } } } catch ( SocketException e ) { } cachedHostname = lastHostname; return lastHostname; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String getHostname() { if ( cachedHostname != null ) { return cachedHostname; } String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { cachedHostname = systemHostname; return systemHostname; } String lastHostname = "localhost"; try { Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); while ( en.hasMoreElements() ) { NetworkInterface nwi = en.nextElement(); Enumeration<InetAddress> ip = nwi.getInetAddresses(); while ( ip.hasMoreElements() ) { InetAddress in = ip.nextElement(); lastHostname = in.getHostName(); if ( !lastHostname.equalsIgnoreCase( "localhost" ) && !( lastHostname.indexOf( ':' ) >= 0 ) ) { break; } } } } catch ( SocketException e ) { } cachedHostname = lastHostname; return lastHostname; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetHostnameReal() { doWithModifiedSystemProperty( "KETTLE_SYSTEM_HOSTNAME", "MyHost", new Runnable() { @Override public void run() { assertEquals( "MyHost", Const.getHostnameReal() ); } } ); }
public static String getHostnameReal() { String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { return systemHostname; } if ( isWindows() ) { return System.getenv( "COMPUTERNAME" ); } else { String hostname = System.getenv( "HOSTNAME" ); if ( hostname != null ) { return hostname; } else { BufferedReader br; try { Process pr = Runtime.getRuntime().exec( "hostname" ); br = new BufferedReader( new InputStreamReader( pr.getInputStream() ) ); String line; if ( ( line = br.readLine() ) != null ) { return line; } pr.waitFor(); br.close(); } catch ( IOException e ) { return getHostname(); } catch ( InterruptedException e ) { return getHostname(); } } } return getHostname(); }
Const { public static String getHostnameReal() { String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { return systemHostname; } if ( isWindows() ) { return System.getenv( "COMPUTERNAME" ); } else { String hostname = System.getenv( "HOSTNAME" ); if ( hostname != null ) { return hostname; } else { BufferedReader br; try { Process pr = Runtime.getRuntime().exec( "hostname" ); br = new BufferedReader( new InputStreamReader( pr.getInputStream() ) ); String line; if ( ( line = br.readLine() ) != null ) { return line; } pr.waitFor(); br.close(); } catch ( IOException e ) { return getHostname(); } catch ( InterruptedException e ) { return getHostname(); } } } return getHostname(); } }
Const { public static String getHostnameReal() { String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { return systemHostname; } if ( isWindows() ) { return System.getenv( "COMPUTERNAME" ); } else { String hostname = System.getenv( "HOSTNAME" ); if ( hostname != null ) { return hostname; } else { BufferedReader br; try { Process pr = Runtime.getRuntime().exec( "hostname" ); br = new BufferedReader( new InputStreamReader( pr.getInputStream() ) ); String line; if ( ( line = br.readLine() ) != null ) { return line; } pr.waitFor(); br.close(); } catch ( IOException e ) { return getHostname(); } catch ( InterruptedException e ) { return getHostname(); } } } return getHostname(); } }
Const { public static String getHostnameReal() { String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { return systemHostname; } if ( isWindows() ) { return System.getenv( "COMPUTERNAME" ); } else { String hostname = System.getenv( "HOSTNAME" ); if ( hostname != null ) { return hostname; } else { BufferedReader br; try { Process pr = Runtime.getRuntime().exec( "hostname" ); br = new BufferedReader( new InputStreamReader( pr.getInputStream() ) ); String line; if ( ( line = br.readLine() ) != null ) { return line; } pr.waitFor(); br.close(); } catch ( IOException e ) { return getHostname(); } catch ( InterruptedException e ) { return getHostname(); } } } return getHostname(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String getHostnameReal() { String systemHostname = EnvUtil.getSystemProperty( KETTLE_SYSTEM_HOSTNAME ); if ( !Utils.isEmpty( systemHostname ) ) { return systemHostname; } if ( isWindows() ) { return System.getenv( "COMPUTERNAME" ); } else { String hostname = System.getenv( "HOSTNAME" ); if ( hostname != null ) { return hostname; } else { BufferedReader br; try { Process pr = Runtime.getRuntime().exec( "hostname" ); br = new BufferedReader( new InputStreamReader( pr.getInputStream() ) ); String line; if ( ( line = br.readLine() ) != null ) { return line; } pr.waitFor(); br.close(); } catch ( IOException e ) { return getHostname(); } catch ( InterruptedException e ) { return getHostname(); } } } return getHostname(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testDisabledHops() { TransMeta trans = new TransMeta(); StepMeta start = new StepMeta( "Start", stepMetaInterface ); trans.addStep( start ); StepMeta withEnabledHop = new StepMeta( "WithEnabledHop", stepMetaInterface ); trans.addStep( withEnabledHop ); StepMeta withDisabledHop = new StepMeta( "WithDisabledHop", stepMetaInterface ); trans.addStep( withDisabledHop ); StepMeta shouldStay = new StepMeta( "ShouldStay", stepMetaInterface ); trans.addStep( shouldStay ); StepMeta shouldNotStay = new StepMeta( "ShouldNotStay", stepMetaInterface ); trans.addStep( shouldNotStay ); StepMeta withEnabledAndDisabledHops = new StepMeta( "WithEnabledAndDisabledHops", stepMetaInterface ); trans.addStep( withEnabledAndDisabledHops ); StepMeta afterEnabledDisabled = new StepMeta( "AfterEnabledDisabled", stepMetaInterface ); trans.addStep( afterEnabledDisabled ); trans.addTransHop( new TransHopMeta( start, withEnabledHop ) ); trans.addTransHop( new TransHopMeta( start, withDisabledHop, false ) ); trans.addTransHop( new TransHopMeta( withEnabledHop, shouldStay ) ); trans.addTransHop( new TransHopMeta( withDisabledHop, shouldStay ) ); trans.addTransHop( new TransHopMeta( withDisabledHop, shouldNotStay ) ); trans.addTransHop( new TransHopMeta( start, withEnabledAndDisabledHops ) ); trans.addTransHop( new TransHopMeta( withEnabledHop, withEnabledAndDisabledHops, false ) ); trans.addTransHop( new TransHopMeta( withEnabledAndDisabledHops, afterEnabledDisabled ) ); Transformation transformation = TransMetaConverter.convert( trans ); List<String> steps = transformation.getOperations().stream().map( op -> op.getId() ).collect( Collectors.toList() ); assertThat( "Only 5 ops should exist", steps.size(), is( 5 ) ); assertThat( steps, hasItems( "Start", "WithEnabledHop", "ShouldStay", "WithEnabledAndDisabledHops", "AfterEnabledDisabled" ) ); List<String> hops = transformation.getHops().stream().map( hop -> hop.getId() ).collect( Collectors.toList() ); assertThat( "Only 4 hops should exist", hops.size(), is( 4 ) ); assertThat( hops, hasItems( "Start -> WithEnabledHop", "WithEnabledHop -> ShouldStay", "Start -> WithEnabledAndDisabledHops", "WithEnabledAndDisabledHops -> AfterEnabledDisabled" ) ); }
public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); static final String TRANS_META_CONF_KEY; static final String TRANS_META_NAME_CONF_KEY; static final String SUB_TRANSFORMATIONS_KEY; static final String STEP_META_CONF_KEY; static final String TRANS_DEFAULT_NAME; }
@Test public void testReplEnv() { assertNull( Const.replEnv( (String) null ) ); System.setProperty( "testProp", "testValue" ); assertEquals( "Value for testProp property is testValue.", Const.replEnv( "Value for testProp property is %%testProp%%." ) ); assertEquals( "Value for testProp property is testValue.", Const.replEnv( new String[] { "Value for testProp property is %%testProp%%." } )[0] ); }
@Deprecated public static String replEnv( String string ) { if ( string == null ) { return null; } StringBuilder str = new StringBuilder( string ); int idx = str.indexOf( "%%" ); while ( idx >= 0 ) { int to = str.indexOf( "%%", idx + 2 ); if ( to >= 0 ) { String marker = str.substring( idx, to + 2 ); String var = str.substring( idx + 2, to ); if ( var != null && var.length() > 0 ) { String newval = getEnvironmentVariable( var, null ); if ( newval != null ) { str.replace( idx, to + 2, newval ); to += newval.length() - marker.length(); } } } else { to = idx; } idx = str.indexOf( "%%", to + 1 ); } return str.toString(); }
Const { @Deprecated public static String replEnv( String string ) { if ( string == null ) { return null; } StringBuilder str = new StringBuilder( string ); int idx = str.indexOf( "%%" ); while ( idx >= 0 ) { int to = str.indexOf( "%%", idx + 2 ); if ( to >= 0 ) { String marker = str.substring( idx, to + 2 ); String var = str.substring( idx + 2, to ); if ( var != null && var.length() > 0 ) { String newval = getEnvironmentVariable( var, null ); if ( newval != null ) { str.replace( idx, to + 2, newval ); to += newval.length() - marker.length(); } } } else { to = idx; } idx = str.indexOf( "%%", to + 1 ); } return str.toString(); } }
Const { @Deprecated public static String replEnv( String string ) { if ( string == null ) { return null; } StringBuilder str = new StringBuilder( string ); int idx = str.indexOf( "%%" ); while ( idx >= 0 ) { int to = str.indexOf( "%%", idx + 2 ); if ( to >= 0 ) { String marker = str.substring( idx, to + 2 ); String var = str.substring( idx + 2, to ); if ( var != null && var.length() > 0 ) { String newval = getEnvironmentVariable( var, null ); if ( newval != null ) { str.replace( idx, to + 2, newval ); to += newval.length() - marker.length(); } } } else { to = idx; } idx = str.indexOf( "%%", to + 1 ); } return str.toString(); } }
Const { @Deprecated public static String replEnv( String string ) { if ( string == null ) { return null; } StringBuilder str = new StringBuilder( string ); int idx = str.indexOf( "%%" ); while ( idx >= 0 ) { int to = str.indexOf( "%%", idx + 2 ); if ( to >= 0 ) { String marker = str.substring( idx, to + 2 ); String var = str.substring( idx + 2, to ); if ( var != null && var.length() > 0 ) { String newval = getEnvironmentVariable( var, null ); if ( newval != null ) { str.replace( idx, to + 2, newval ); to += newval.length() - marker.length(); } } } else { to = idx; } idx = str.indexOf( "%%", to + 1 ); } return str.toString(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { @Deprecated public static String replEnv( String string ) { if ( string == null ) { return null; } StringBuilder str = new StringBuilder( string ); int idx = str.indexOf( "%%" ); while ( idx >= 0 ) { int to = str.indexOf( "%%", idx + 2 ); if ( to >= 0 ) { String marker = str.substring( idx, to + 2 ); String var = str.substring( idx + 2, to ); if ( var != null && var.length() > 0 ) { String newval = getEnvironmentVariable( var, null ); if ( newval != null ) { str.replace( idx, to + 2, newval ); to += newval.length() - marker.length(); } } } else { to = idx; } idx = str.indexOf( "%%", to + 1 ); } return str.toString(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testNullToEmpty() { assertEquals( "", Const.nullToEmpty( null ) ); assertEquals( "value", Const.nullToEmpty( "value" ) ); }
public static String nullToEmpty( String source ) { if ( source == null ) { return ""; } return source; }
Const { public static String nullToEmpty( String source ) { if ( source == null ) { return ""; } return source; } }
Const { public static String nullToEmpty( String source ) { if ( source == null ) { return ""; } return source; } }
Const { public static String nullToEmpty( String source ) { if ( source == null ) { return ""; } return source; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String nullToEmpty( String source ) { if ( source == null ) { return ""; } return source; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testIndexOfString() { assertEquals( -1, Const.indexOfString( null, (String[]) null ) ); assertEquals( -1, Const.indexOfString( null, new String[] {} ) ); assertEquals( 1, Const.indexOfString( "bar", new String[] { "foo", "bar" } ) ); assertEquals( -1, Const.indexOfString( "baz", new String[] { "foo", "bar" } ) ); assertEquals( -1, Const.indexOfString( null, (List<String>) null ) ); assertEquals( 1, Const.indexOfString( "bar", Arrays.asList( "foo", "bar" ) ) ); assertEquals( -1, Const.indexOfString( "baz", Arrays.asList( "foo", "bar" ) ) ); }
public static int indexOfString( String lookup, String[] array ) { if ( array == null ) { return -1; } if ( lookup == null ) { return -1; } for ( int i = 0; i < array.length; i++ ) { if ( lookup.equalsIgnoreCase( array[i] ) ) { return i; } } return -1; }
Const { public static int indexOfString( String lookup, String[] array ) { if ( array == null ) { return -1; } if ( lookup == null ) { return -1; } for ( int i = 0; i < array.length; i++ ) { if ( lookup.equalsIgnoreCase( array[i] ) ) { return i; } } return -1; } }
Const { public static int indexOfString( String lookup, String[] array ) { if ( array == null ) { return -1; } if ( lookup == null ) { return -1; } for ( int i = 0; i < array.length; i++ ) { if ( lookup.equalsIgnoreCase( array[i] ) ) { return i; } } return -1; } }
Const { public static int indexOfString( String lookup, String[] array ) { if ( array == null ) { return -1; } if ( lookup == null ) { return -1; } for ( int i = 0; i < array.length; i++ ) { if ( lookup.equalsIgnoreCase( array[i] ) ) { return i; } } return -1; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static int indexOfString( String lookup, String[] array ) { if ( array == null ) { return -1; } if ( lookup == null ) { return -1; } for ( int i = 0; i < array.length; i++ ) { if ( lookup.equalsIgnoreCase( array[i] ) ) { return i; } } return -1; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testIndexsOfStrings() { Assert.assertArrayEquals( new int[] { 2, 1, -1 }, Const.indexsOfStrings( new String[] { "foo", "bar", "qux" }, new String[] { "baz", "bar", "foo" } ) ); }
public static int[] indexsOfStrings( String[] lookup, String[] array ) { int[] indexes = new int[lookup.length]; for ( int i = 0; i < indexes.length; i++ ) { indexes[i] = indexOfString( lookup[i], array ); } return indexes; }
Const { public static int[] indexsOfStrings( String[] lookup, String[] array ) { int[] indexes = new int[lookup.length]; for ( int i = 0; i < indexes.length; i++ ) { indexes[i] = indexOfString( lookup[i], array ); } return indexes; } }
Const { public static int[] indexsOfStrings( String[] lookup, String[] array ) { int[] indexes = new int[lookup.length]; for ( int i = 0; i < indexes.length; i++ ) { indexes[i] = indexOfString( lookup[i], array ); } return indexes; } }
Const { public static int[] indexsOfStrings( String[] lookup, String[] array ) { int[] indexes = new int[lookup.length]; for ( int i = 0; i < indexes.length; i++ ) { indexes[i] = indexOfString( lookup[i], array ); } return indexes; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static int[] indexsOfStrings( String[] lookup, String[] array ) { int[] indexes = new int[lookup.length]; for ( int i = 0; i < indexes.length; i++ ) { indexes[i] = indexOfString( lookup[i], array ); } return indexes; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testIndexsOfFoundStrings() { Assert.assertArrayEquals( new int[] { 2, 1 }, Const.indexsOfFoundStrings( new String[] { "qux", "foo", "bar" }, new String[] { "baz", "bar", "foo" } ) ); }
public static int[] indexsOfFoundStrings( String[] lookup, String[] array ) { List<Integer> indexesList = new ArrayList<>(); for ( int i = 0; i < lookup.length; i++ ) { int idx = indexOfString( lookup[i], array ); if ( idx >= 0 ) { indexesList.add( Integer.valueOf( idx ) ); } } int[] indexes = new int[indexesList.size()]; for ( int i = 0; i < indexesList.size(); i++ ) { indexes[i] = ( indexesList.get( i ) ).intValue(); } return indexes; }
Const { public static int[] indexsOfFoundStrings( String[] lookup, String[] array ) { List<Integer> indexesList = new ArrayList<>(); for ( int i = 0; i < lookup.length; i++ ) { int idx = indexOfString( lookup[i], array ); if ( idx >= 0 ) { indexesList.add( Integer.valueOf( idx ) ); } } int[] indexes = new int[indexesList.size()]; for ( int i = 0; i < indexesList.size(); i++ ) { indexes[i] = ( indexesList.get( i ) ).intValue(); } return indexes; } }
Const { public static int[] indexsOfFoundStrings( String[] lookup, String[] array ) { List<Integer> indexesList = new ArrayList<>(); for ( int i = 0; i < lookup.length; i++ ) { int idx = indexOfString( lookup[i], array ); if ( idx >= 0 ) { indexesList.add( Integer.valueOf( idx ) ); } } int[] indexes = new int[indexesList.size()]; for ( int i = 0; i < indexesList.size(); i++ ) { indexes[i] = ( indexesList.get( i ) ).intValue(); } return indexes; } }
Const { public static int[] indexsOfFoundStrings( String[] lookup, String[] array ) { List<Integer> indexesList = new ArrayList<>(); for ( int i = 0; i < lookup.length; i++ ) { int idx = indexOfString( lookup[i], array ); if ( idx >= 0 ) { indexesList.add( Integer.valueOf( idx ) ); } } int[] indexes = new int[indexesList.size()]; for ( int i = 0; i < indexesList.size(); i++ ) { indexes[i] = ( indexesList.get( i ) ).intValue(); } return indexes; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static int[] indexsOfFoundStrings( String[] lookup, String[] array ) { List<Integer> indexesList = new ArrayList<>(); for ( int i = 0; i < lookup.length; i++ ) { int idx = indexOfString( lookup[i], array ); if ( idx >= 0 ) { indexesList.add( Integer.valueOf( idx ) ); } } int[] indexes = new int[indexesList.size()]; for ( int i = 0; i < indexesList.size(); i++ ) { indexes[i] = ( indexesList.get( i ) ).intValue(); } return indexes; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetDistinctStrings() { assertNull( Const.getDistinctStrings( null ) ); assertTrue( Const.getDistinctStrings( new String[] {} ).length == 0 ); Assert.assertArrayEquals( new String[] { "bar", "foo" }, Const.getDistinctStrings( new String[] { "foo", "bar", "foo", "bar" } ) ); }
public static String[] getDistinctStrings( String[] strings ) { if ( strings == null ) { return null; } if ( strings.length == 0 ) { return new String[] {}; } String[] sorted = sortStrings( strings ); List<String> result = new ArrayList<>(); String previous = ""; for ( int i = 0; i < sorted.length; i++ ) { if ( !sorted[i].equalsIgnoreCase( previous ) ) { result.add( sorted[i] ); } previous = sorted[i]; } return result.toArray( new String[result.size()] ); }
Const { public static String[] getDistinctStrings( String[] strings ) { if ( strings == null ) { return null; } if ( strings.length == 0 ) { return new String[] {}; } String[] sorted = sortStrings( strings ); List<String> result = new ArrayList<>(); String previous = ""; for ( int i = 0; i < sorted.length; i++ ) { if ( !sorted[i].equalsIgnoreCase( previous ) ) { result.add( sorted[i] ); } previous = sorted[i]; } return result.toArray( new String[result.size()] ); } }
Const { public static String[] getDistinctStrings( String[] strings ) { if ( strings == null ) { return null; } if ( strings.length == 0 ) { return new String[] {}; } String[] sorted = sortStrings( strings ); List<String> result = new ArrayList<>(); String previous = ""; for ( int i = 0; i < sorted.length; i++ ) { if ( !sorted[i].equalsIgnoreCase( previous ) ) { result.add( sorted[i] ); } previous = sorted[i]; } return result.toArray( new String[result.size()] ); } }
Const { public static String[] getDistinctStrings( String[] strings ) { if ( strings == null ) { return null; } if ( strings.length == 0 ) { return new String[] {}; } String[] sorted = sortStrings( strings ); List<String> result = new ArrayList<>(); String previous = ""; for ( int i = 0; i < sorted.length; i++ ) { if ( !sorted[i].equalsIgnoreCase( previous ) ) { result.add( sorted[i] ); } previous = sorted[i]; } return result.toArray( new String[result.size()] ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String[] getDistinctStrings( String[] strings ) { if ( strings == null ) { return null; } if ( strings.length == 0 ) { return new String[] {}; } String[] sorted = sortStrings( strings ); List<String> result = new ArrayList<>(); String previous = ""; for ( int i = 0; i < sorted.length; i++ ) { if ( !sorted[i].equalsIgnoreCase( previous ) ) { result.add( sorted[i] ); } previous = sorted[i]; } return result.toArray( new String[result.size()] ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testStackTracker() { assertTrue( Const.getStackTracker( new Exception() ).contains( getClass().getName() + ".testStackTracker(" + getClass().getSimpleName() + ".java:" ) ); }
public static String getStackTracker( Throwable e ) { return getClassicStackTrace( e ); }
Const { public static String getStackTracker( Throwable e ) { return getClassicStackTrace( e ); } }
Const { public static String getStackTracker( Throwable e ) { return getClassicStackTrace( e ); } }
Const { public static String getStackTracker( Throwable e ) { return getClassicStackTrace( e ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String getStackTracker( Throwable e ) { return getClassicStackTrace( e ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetCustomStackTrace() { assertTrue( Const.getCustomStackTrace( new Exception() ).contains( getClass().getName() + ".testGetCustomStackTrace(" + getClass().getSimpleName() + ".java:" ) ); }
public static String getCustomStackTrace( Throwable aThrowable ) { final StringBuilder result = new StringBuilder(); String errorMessage = aThrowable.toString(); result.append( errorMessage ); if ( !errorMessage.contains( Const.CR ) ) { result.append( CR ); } for ( StackTraceElement element : aThrowable.getStackTrace() ) { result.append( element ); result.append( CR ); } return result.toString(); }
Const { public static String getCustomStackTrace( Throwable aThrowable ) { final StringBuilder result = new StringBuilder(); String errorMessage = aThrowable.toString(); result.append( errorMessage ); if ( !errorMessage.contains( Const.CR ) ) { result.append( CR ); } for ( StackTraceElement element : aThrowable.getStackTrace() ) { result.append( element ); result.append( CR ); } return result.toString(); } }
Const { public static String getCustomStackTrace( Throwable aThrowable ) { final StringBuilder result = new StringBuilder(); String errorMessage = aThrowable.toString(); result.append( errorMessage ); if ( !errorMessage.contains( Const.CR ) ) { result.append( CR ); } for ( StackTraceElement element : aThrowable.getStackTrace() ) { result.append( element ); result.append( CR ); } return result.toString(); } }
Const { public static String getCustomStackTrace( Throwable aThrowable ) { final StringBuilder result = new StringBuilder(); String errorMessage = aThrowable.toString(); result.append( errorMessage ); if ( !errorMessage.contains( Const.CR ) ) { result.append( CR ); } for ( StackTraceElement element : aThrowable.getStackTrace() ) { result.append( element ); result.append( CR ); } return result.toString(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String getCustomStackTrace( Throwable aThrowable ) { final StringBuilder result = new StringBuilder(); String errorMessage = aThrowable.toString(); result.append( errorMessage ); if ( !errorMessage.contains( Const.CR ) ) { result.append( CR ); } for ( StackTraceElement element : aThrowable.getStackTrace() ) { result.append( element ); result.append( CR ); } return result.toString(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testCreateNewClassLoader() throws KettleException { ClassLoader cl = Const.createNewClassLoader(); assertTrue( cl instanceof URLClassLoader && ( (URLClassLoader) cl ).getURLs().length == 0 ); }
public static ClassLoader createNewClassLoader() throws KettleException { try { URL[] urls = new URL[] {}; URLClassLoader ucl = new URLClassLoader( urls ); return ucl; } catch ( Exception e ) { throw new KettleException( "Unexpected error during classloader creation", e ); } }
Const { public static ClassLoader createNewClassLoader() throws KettleException { try { URL[] urls = new URL[] {}; URLClassLoader ucl = new URLClassLoader( urls ); return ucl; } catch ( Exception e ) { throw new KettleException( "Unexpected error during classloader creation", e ); } } }
Const { public static ClassLoader createNewClassLoader() throws KettleException { try { URL[] urls = new URL[] {}; URLClassLoader ucl = new URLClassLoader( urls ); return ucl; } catch ( Exception e ) { throw new KettleException( "Unexpected error during classloader creation", e ); } } }
Const { public static ClassLoader createNewClassLoader() throws KettleException { try { URL[] urls = new URL[] {}; URLClassLoader ucl = new URLClassLoader( urls ); return ucl; } catch ( Exception e ) { throw new KettleException( "Unexpected error during classloader creation", e ); } } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static ClassLoader createNewClassLoader() throws KettleException { try { URL[] urls = new URL[] {}; URLClassLoader ucl = new URLClassLoader( urls ); return ucl; } catch ( Exception e ) { throw new KettleException( "Unexpected error during classloader creation", e ); } } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testCreateByteArray() { assertTrue( Const.createByteArray( 5 ).length == 5 ); }
public static byte[] createByteArray( int size ) { return new byte[size]; }
Const { public static byte[] createByteArray( int size ) { return new byte[size]; } }
Const { public static byte[] createByteArray( int size ) { return new byte[size]; } }
Const { public static byte[] createByteArray( int size ) { return new byte[size]; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static byte[] createByteArray( int size ) { return new byte[size]; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testRemovingDisabledInputSteps() { TransMeta trans = new TransMeta(); StepMeta inputToBeRemoved = new StepMeta( "InputToBeRemoved", stepMetaInterface ); trans.addStep( inputToBeRemoved ); StepMeta inputToStay = new StepMeta( "InputToStay", stepMetaInterface ); trans.addStep( inputToStay ); StepMeta inputReceiver1 = new StepMeta( "InputReceiver1", stepMetaInterface ); trans.addStep( inputReceiver1 ); StepMeta inputReceiver2 = new StepMeta( "InputReceiver2", stepMetaInterface ); trans.addStep( inputReceiver2 ); TransHopMeta hop1 = new TransHopMeta( inputToBeRemoved, inputReceiver1, false ); TransHopMeta hop2 = new TransHopMeta( inputToStay, inputReceiver1 ); TransHopMeta hop3 = new TransHopMeta( inputToBeRemoved, inputReceiver2, false ); trans.addTransHop( hop1 ); trans.addTransHop( hop2 ); trans.addTransHop( hop3 ); Transformation transformation = TransMetaConverter.convert( trans ); List<String> steps = transformation.getOperations().stream().map( op -> op.getId() ).collect( Collectors.toList() ); assertThat( "Only 2 ops should exist", steps.size(), is( 2 ) ); assertThat( steps, hasItems( "InputToStay", "InputReceiver1" ) ); List<String> hops = transformation.getHops().stream().map( hop -> hop.getId() ).collect( Collectors.toList() ); assertThat( "Only 1 hop should exist", hops.size(), is( 1 ) ); assertThat( hops, hasItems( "InputToStay -> InputReceiver1" ) ); }
public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); static final String TRANS_META_CONF_KEY; static final String TRANS_META_NAME_CONF_KEY; static final String SUB_TRANSFORMATIONS_KEY; static final String STEP_META_CONF_KEY; static final String TRANS_DEFAULT_NAME; }
@Test public void testCreateFilename() { assertEquals( "dir" + Const.FILE_SEPARATOR + "file__1.ext", Const.createFilename( "dir" + Const.FILE_SEPARATOR, "File\t~ 1", ".ext" ) ); assertEquals( "dir" + Const.FILE_SEPARATOR + "file__1.ext", Const.createFilename( "dir", "File\t~ 1", ".ext" ) ); }
public static String createFilename( String name ) { StringBuilder filename = new StringBuilder(); for ( int i = 0; i < name.length(); i++ ) { char c = name.charAt( i ); if ( Character.isUnicodeIdentifierPart( c ) ) { filename.append( c ); } else if ( Character.isWhitespace( c ) ) { filename.append( '_' ); } } return filename.toString().toLowerCase(); }
Const { public static String createFilename( String name ) { StringBuilder filename = new StringBuilder(); for ( int i = 0; i < name.length(); i++ ) { char c = name.charAt( i ); if ( Character.isUnicodeIdentifierPart( c ) ) { filename.append( c ); } else if ( Character.isWhitespace( c ) ) { filename.append( '_' ); } } return filename.toString().toLowerCase(); } }
Const { public static String createFilename( String name ) { StringBuilder filename = new StringBuilder(); for ( int i = 0; i < name.length(); i++ ) { char c = name.charAt( i ); if ( Character.isUnicodeIdentifierPart( c ) ) { filename.append( c ); } else if ( Character.isWhitespace( c ) ) { filename.append( '_' ); } } return filename.toString().toLowerCase(); } }
Const { public static String createFilename( String name ) { StringBuilder filename = new StringBuilder(); for ( int i = 0; i < name.length(); i++ ) { char c = name.charAt( i ); if ( Character.isUnicodeIdentifierPart( c ) ) { filename.append( c ); } else if ( Character.isWhitespace( c ) ) { filename.append( '_' ); } } return filename.toString().toLowerCase(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String createFilename( String name ) { StringBuilder filename = new StringBuilder(); for ( int i = 0; i < name.length(); i++ ) { char c = name.charAt( i ); if ( Character.isUnicodeIdentifierPart( c ) ) { filename.append( c ); } else if ( Character.isWhitespace( c ) ) { filename.append( '_' ); } } return filename.toString().toLowerCase(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testCreateName() { assertNull( Const.createName( null ) ); assertEquals( "test - trans", Const.createName( "transformations" + Const.FILE_SEPARATOR + "test\t~- trans.ktr" ) ); }
public static String createName( String filename ) { if ( Utils.isEmpty( filename ) ) { return filename; } String pureFilename = filenameOnly( filename ); if ( pureFilename.endsWith( ".ktr" ) || pureFilename.endsWith( ".kjb" ) || pureFilename.endsWith( ".xml" ) ) { pureFilename = pureFilename.substring( 0, pureFilename.length() - 4 ); } StringBuilder sb = new StringBuilder(); for ( int i = 0; i < pureFilename.length(); i++ ) { char c = pureFilename.charAt( i ); if ( Character.isUnicodeIdentifierPart( c ) ) { sb.append( c ); } else if ( Character.isWhitespace( c ) ) { sb.append( ' ' ); } else if ( c == '-' ) { sb.append( c ); } } return sb.toString(); }
Const { public static String createName( String filename ) { if ( Utils.isEmpty( filename ) ) { return filename; } String pureFilename = filenameOnly( filename ); if ( pureFilename.endsWith( ".ktr" ) || pureFilename.endsWith( ".kjb" ) || pureFilename.endsWith( ".xml" ) ) { pureFilename = pureFilename.substring( 0, pureFilename.length() - 4 ); } StringBuilder sb = new StringBuilder(); for ( int i = 0; i < pureFilename.length(); i++ ) { char c = pureFilename.charAt( i ); if ( Character.isUnicodeIdentifierPart( c ) ) { sb.append( c ); } else if ( Character.isWhitespace( c ) ) { sb.append( ' ' ); } else if ( c == '-' ) { sb.append( c ); } } return sb.toString(); } }
Const { public static String createName( String filename ) { if ( Utils.isEmpty( filename ) ) { return filename; } String pureFilename = filenameOnly( filename ); if ( pureFilename.endsWith( ".ktr" ) || pureFilename.endsWith( ".kjb" ) || pureFilename.endsWith( ".xml" ) ) { pureFilename = pureFilename.substring( 0, pureFilename.length() - 4 ); } StringBuilder sb = new StringBuilder(); for ( int i = 0; i < pureFilename.length(); i++ ) { char c = pureFilename.charAt( i ); if ( Character.isUnicodeIdentifierPart( c ) ) { sb.append( c ); } else if ( Character.isWhitespace( c ) ) { sb.append( ' ' ); } else if ( c == '-' ) { sb.append( c ); } } return sb.toString(); } }
Const { public static String createName( String filename ) { if ( Utils.isEmpty( filename ) ) { return filename; } String pureFilename = filenameOnly( filename ); if ( pureFilename.endsWith( ".ktr" ) || pureFilename.endsWith( ".kjb" ) || pureFilename.endsWith( ".xml" ) ) { pureFilename = pureFilename.substring( 0, pureFilename.length() - 4 ); } StringBuilder sb = new StringBuilder(); for ( int i = 0; i < pureFilename.length(); i++ ) { char c = pureFilename.charAt( i ); if ( Character.isUnicodeIdentifierPart( c ) ) { sb.append( c ); } else if ( Character.isWhitespace( c ) ) { sb.append( ' ' ); } else if ( c == '-' ) { sb.append( c ); } } return sb.toString(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String createName( String filename ) { if ( Utils.isEmpty( filename ) ) { return filename; } String pureFilename = filenameOnly( filename ); if ( pureFilename.endsWith( ".ktr" ) || pureFilename.endsWith( ".kjb" ) || pureFilename.endsWith( ".xml" ) ) { pureFilename = pureFilename.substring( 0, pureFilename.length() - 4 ); } StringBuilder sb = new StringBuilder(); for ( int i = 0; i < pureFilename.length(); i++ ) { char c = pureFilename.charAt( i ); if ( Character.isUnicodeIdentifierPart( c ) ) { sb.append( c ); } else if ( Character.isWhitespace( c ) ) { sb.append( ' ' ); } else if ( c == '-' ) { sb.append( c ); } } return sb.toString(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testFilenameOnly() { assertNull( Const.filenameOnly( null ) ); assertTrue( Const.filenameOnly( "" ).isEmpty() ); assertEquals( "file.txt", Const.filenameOnly( "dir" + Const.FILE_SEPARATOR + "file.txt" ) ); assertEquals( "file.txt", Const.filenameOnly( "file.txt" ) ); }
public static String filenameOnly( String sFullPath ) { if ( Utils.isEmpty( sFullPath ) ) { return sFullPath; } int idx = sFullPath.lastIndexOf( FILE_SEPARATOR ); if ( idx != -1 ) { return sFullPath.substring( idx + 1 ); } else { idx = sFullPath.lastIndexOf( '/' ); if ( idx != -1 ) { return sFullPath.substring( idx + 1 ); } else { return sFullPath; } } }
Const { public static String filenameOnly( String sFullPath ) { if ( Utils.isEmpty( sFullPath ) ) { return sFullPath; } int idx = sFullPath.lastIndexOf( FILE_SEPARATOR ); if ( idx != -1 ) { return sFullPath.substring( idx + 1 ); } else { idx = sFullPath.lastIndexOf( '/' ); if ( idx != -1 ) { return sFullPath.substring( idx + 1 ); } else { return sFullPath; } } } }
Const { public static String filenameOnly( String sFullPath ) { if ( Utils.isEmpty( sFullPath ) ) { return sFullPath; } int idx = sFullPath.lastIndexOf( FILE_SEPARATOR ); if ( idx != -1 ) { return sFullPath.substring( idx + 1 ); } else { idx = sFullPath.lastIndexOf( '/' ); if ( idx != -1 ) { return sFullPath.substring( idx + 1 ); } else { return sFullPath; } } } }
Const { public static String filenameOnly( String sFullPath ) { if ( Utils.isEmpty( sFullPath ) ) { return sFullPath; } int idx = sFullPath.lastIndexOf( FILE_SEPARATOR ); if ( idx != -1 ) { return sFullPath.substring( idx + 1 ); } else { idx = sFullPath.lastIndexOf( '/' ); if ( idx != -1 ) { return sFullPath.substring( idx + 1 ); } else { return sFullPath; } } } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String filenameOnly( String sFullPath ) { if ( Utils.isEmpty( sFullPath ) ) { return sFullPath; } int idx = sFullPath.lastIndexOf( FILE_SEPARATOR ); if ( idx != -1 ) { return sFullPath.substring( idx + 1 ); } else { idx = sFullPath.lastIndexOf( '/' ); if ( idx != -1 ) { return sFullPath.substring( idx + 1 ); } else { return sFullPath; } } } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetDateFormats() { final String[] formats = Const.getDateFormats(); assertTrue( formats.length > 0 ); for ( String format : formats ) { assertTrue( format != null && !format.isEmpty() ); } }
public static String[] getDateFormats() { if ( dateFormats == null ) { int dateFormatsCount = toInt( BaseMessages.getString( PKG, "Const.DateFormat.Count" ), 0 ); dateFormats = new String[dateFormatsCount]; for ( int i = 1; i <= dateFormatsCount; i++ ) { dateFormats[i - 1] = BaseMessages.getString( PKG, "Const.DateFormat" + Integer.toString( i ) ); } } return dateFormats; }
Const { public static String[] getDateFormats() { if ( dateFormats == null ) { int dateFormatsCount = toInt( BaseMessages.getString( PKG, "Const.DateFormat.Count" ), 0 ); dateFormats = new String[dateFormatsCount]; for ( int i = 1; i <= dateFormatsCount; i++ ) { dateFormats[i - 1] = BaseMessages.getString( PKG, "Const.DateFormat" + Integer.toString( i ) ); } } return dateFormats; } }
Const { public static String[] getDateFormats() { if ( dateFormats == null ) { int dateFormatsCount = toInt( BaseMessages.getString( PKG, "Const.DateFormat.Count" ), 0 ); dateFormats = new String[dateFormatsCount]; for ( int i = 1; i <= dateFormatsCount; i++ ) { dateFormats[i - 1] = BaseMessages.getString( PKG, "Const.DateFormat" + Integer.toString( i ) ); } } return dateFormats; } }
Const { public static String[] getDateFormats() { if ( dateFormats == null ) { int dateFormatsCount = toInt( BaseMessages.getString( PKG, "Const.DateFormat.Count" ), 0 ); dateFormats = new String[dateFormatsCount]; for ( int i = 1; i <= dateFormatsCount; i++ ) { dateFormats[i - 1] = BaseMessages.getString( PKG, "Const.DateFormat" + Integer.toString( i ) ); } } return dateFormats; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String[] getDateFormats() { if ( dateFormats == null ) { int dateFormatsCount = toInt( BaseMessages.getString( PKG, "Const.DateFormat.Count" ), 0 ); dateFormats = new String[dateFormatsCount]; for ( int i = 1; i <= dateFormatsCount; i++ ) { dateFormats[i - 1] = BaseMessages.getString( PKG, "Const.DateFormat" + Integer.toString( i ) ); } } return dateFormats; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetNumberFormats() { final String[] formats = Const.getNumberFormats(); assertTrue( formats.length > 0 ); for ( String format : formats ) { assertTrue( format != null && !format.isEmpty() ); } }
public static String[] getNumberFormats() { if ( numberFormats == null ) { int numberFormatsCount = toInt( BaseMessages.getString( PKG, "Const.NumberFormat.Count" ), 0 ); numberFormats = new String[numberFormatsCount + 1]; numberFormats[0] = DEFAULT_NUMBER_FORMAT; for ( int i = 1; i <= numberFormatsCount; i++ ) { numberFormats[i] = BaseMessages.getString( PKG, "Const.NumberFormat" + Integer.toString( i ) ); } } return numberFormats; }
Const { public static String[] getNumberFormats() { if ( numberFormats == null ) { int numberFormatsCount = toInt( BaseMessages.getString( PKG, "Const.NumberFormat.Count" ), 0 ); numberFormats = new String[numberFormatsCount + 1]; numberFormats[0] = DEFAULT_NUMBER_FORMAT; for ( int i = 1; i <= numberFormatsCount; i++ ) { numberFormats[i] = BaseMessages.getString( PKG, "Const.NumberFormat" + Integer.toString( i ) ); } } return numberFormats; } }
Const { public static String[] getNumberFormats() { if ( numberFormats == null ) { int numberFormatsCount = toInt( BaseMessages.getString( PKG, "Const.NumberFormat.Count" ), 0 ); numberFormats = new String[numberFormatsCount + 1]; numberFormats[0] = DEFAULT_NUMBER_FORMAT; for ( int i = 1; i <= numberFormatsCount; i++ ) { numberFormats[i] = BaseMessages.getString( PKG, "Const.NumberFormat" + Integer.toString( i ) ); } } return numberFormats; } }
Const { public static String[] getNumberFormats() { if ( numberFormats == null ) { int numberFormatsCount = toInt( BaseMessages.getString( PKG, "Const.NumberFormat.Count" ), 0 ); numberFormats = new String[numberFormatsCount + 1]; numberFormats[0] = DEFAULT_NUMBER_FORMAT; for ( int i = 1; i <= numberFormatsCount; i++ ) { numberFormats[i] = BaseMessages.getString( PKG, "Const.NumberFormat" + Integer.toString( i ) ); } } return numberFormats; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String[] getNumberFormats() { if ( numberFormats == null ) { int numberFormatsCount = toInt( BaseMessages.getString( PKG, "Const.NumberFormat.Count" ), 0 ); numberFormats = new String[numberFormatsCount + 1]; numberFormats[0] = DEFAULT_NUMBER_FORMAT; for ( int i = 1; i <= numberFormatsCount; i++ ) { numberFormats[i] = BaseMessages.getString( PKG, "Const.NumberFormat" + Integer.toString( i ) ); } } return numberFormats; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetConversionFormats() { final List<String> dateFormats = Arrays.asList( Const.getDateFormats() ); final List<String> numberFormats = Arrays.asList( Const.getNumberFormats() ); final List<String> conversionFormats = Arrays.asList( Const.getConversionFormats() ); assertEquals( dateFormats.size() + numberFormats.size(), conversionFormats.size() ); assertTrue( conversionFormats.containsAll( dateFormats ) ); assertTrue( conversionFormats.containsAll( numberFormats ) ); }
public static String[] getConversionFormats() { String[] dats = Const.getDateFormats(); String[] nums = Const.getNumberFormats(); int totsize = dats.length + nums.length; String[] formats = new String[totsize]; for ( int x = 0; x < dats.length; x++ ) { formats[x] = dats[x]; } for ( int x = 0; x < nums.length; x++ ) { formats[dats.length + x] = nums[x]; } return formats; }
Const { public static String[] getConversionFormats() { String[] dats = Const.getDateFormats(); String[] nums = Const.getNumberFormats(); int totsize = dats.length + nums.length; String[] formats = new String[totsize]; for ( int x = 0; x < dats.length; x++ ) { formats[x] = dats[x]; } for ( int x = 0; x < nums.length; x++ ) { formats[dats.length + x] = nums[x]; } return formats; } }
Const { public static String[] getConversionFormats() { String[] dats = Const.getDateFormats(); String[] nums = Const.getNumberFormats(); int totsize = dats.length + nums.length; String[] formats = new String[totsize]; for ( int x = 0; x < dats.length; x++ ) { formats[x] = dats[x]; } for ( int x = 0; x < nums.length; x++ ) { formats[dats.length + x] = nums[x]; } return formats; } }
Const { public static String[] getConversionFormats() { String[] dats = Const.getDateFormats(); String[] nums = Const.getNumberFormats(); int totsize = dats.length + nums.length; String[] formats = new String[totsize]; for ( int x = 0; x < dats.length; x++ ) { formats[x] = dats[x]; } for ( int x = 0; x < nums.length; x++ ) { formats[dats.length + x] = nums[x]; } return formats; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String[] getConversionFormats() { String[] dats = Const.getDateFormats(); String[] nums = Const.getNumberFormats(); int totsize = dats.length + nums.length; String[] formats = new String[totsize]; for ( int x = 0; x < dats.length; x++ ) { formats[x] = dats[x]; } for ( int x = 0; x < nums.length; x++ ) { formats[dats.length + x] = nums[x]; } return formats; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetTransformationAndJobFilterNames() { List<String> filters = Arrays.asList( Const.getTransformationAndJobFilterNames() ); assertTrue( filters.size() == 5 ); for ( String filter : filters ) { assertFalse( filter.isEmpty() ); } }
public static String[] getTransformationAndJobFilterNames() { if ( STRING_TRANS_AND_JOB_FILTER_NAMES == null ) { STRING_TRANS_AND_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.TransformationJob" ), BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages.getString( PKG, "Const.FileFilter.Jobs" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_TRANS_AND_JOB_FILTER_NAMES; }
Const { public static String[] getTransformationAndJobFilterNames() { if ( STRING_TRANS_AND_JOB_FILTER_NAMES == null ) { STRING_TRANS_AND_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.TransformationJob" ), BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages.getString( PKG, "Const.FileFilter.Jobs" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_TRANS_AND_JOB_FILTER_NAMES; } }
Const { public static String[] getTransformationAndJobFilterNames() { if ( STRING_TRANS_AND_JOB_FILTER_NAMES == null ) { STRING_TRANS_AND_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.TransformationJob" ), BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages.getString( PKG, "Const.FileFilter.Jobs" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_TRANS_AND_JOB_FILTER_NAMES; } }
Const { public static String[] getTransformationAndJobFilterNames() { if ( STRING_TRANS_AND_JOB_FILTER_NAMES == null ) { STRING_TRANS_AND_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.TransformationJob" ), BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages.getString( PKG, "Const.FileFilter.Jobs" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_TRANS_AND_JOB_FILTER_NAMES; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String[] getTransformationAndJobFilterNames() { if ( STRING_TRANS_AND_JOB_FILTER_NAMES == null ) { STRING_TRANS_AND_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.TransformationJob" ), BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages.getString( PKG, "Const.FileFilter.Jobs" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_TRANS_AND_JOB_FILTER_NAMES; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetTransformationFilterNames() { List<String> filters = Arrays.asList( Const.getTransformationFilterNames() ); assertTrue( filters.size() == 3 ); for ( String filter : filters ) { assertFalse( filter.isEmpty() ); } }
public static String[] getTransformationFilterNames() { if ( STRING_TRANS_FILTER_NAMES == null ) { STRING_TRANS_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_TRANS_FILTER_NAMES; }
Const { public static String[] getTransformationFilterNames() { if ( STRING_TRANS_FILTER_NAMES == null ) { STRING_TRANS_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_TRANS_FILTER_NAMES; } }
Const { public static String[] getTransformationFilterNames() { if ( STRING_TRANS_FILTER_NAMES == null ) { STRING_TRANS_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_TRANS_FILTER_NAMES; } }
Const { public static String[] getTransformationFilterNames() { if ( STRING_TRANS_FILTER_NAMES == null ) { STRING_TRANS_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_TRANS_FILTER_NAMES; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String[] getTransformationFilterNames() { if ( STRING_TRANS_FILTER_NAMES == null ) { STRING_TRANS_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Transformations" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_TRANS_FILTER_NAMES; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetJobFilterNames() { List<String> filters = Arrays.asList( Const.getJobFilterNames() ); assertTrue( filters.size() == 3 ); for ( String filter : filters ) { assertFalse( filter.isEmpty() ); } }
public static String[] getJobFilterNames() { if ( STRING_JOB_FILTER_NAMES == null ) { STRING_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Jobs" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_JOB_FILTER_NAMES; }
Const { public static String[] getJobFilterNames() { if ( STRING_JOB_FILTER_NAMES == null ) { STRING_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Jobs" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_JOB_FILTER_NAMES; } }
Const { public static String[] getJobFilterNames() { if ( STRING_JOB_FILTER_NAMES == null ) { STRING_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Jobs" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_JOB_FILTER_NAMES; } }
Const { public static String[] getJobFilterNames() { if ( STRING_JOB_FILTER_NAMES == null ) { STRING_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Jobs" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_JOB_FILTER_NAMES; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String[] getJobFilterNames() { if ( STRING_JOB_FILTER_NAMES == null ) { STRING_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Jobs" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Const.FileFilter.All" ) }; } return STRING_JOB_FILTER_NAMES; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testNanoTime() { assertTrue( String.valueOf( Const.nanoTime() ).endsWith( "000" ) ); }
public static long nanoTime() { return new Date().getTime() * 1000; }
Const { public static long nanoTime() { return new Date().getTime() * 1000; } }
Const { public static long nanoTime() { return new Date().getTime() * 1000; } }
Const { public static long nanoTime() { return new Date().getTime() * 1000; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static long nanoTime() { return new Date().getTime() * 1000; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testMultipleDisabledHops() { TransMeta trans = new TransMeta(); StepMeta input = new StepMeta( "Input", stepMetaInterface ); trans.addStep( input ); StepMeta step1 = new StepMeta( "Step1", stepMetaInterface ); trans.addStep( step1 ); StepMeta step2 = new StepMeta( "Step2", stepMetaInterface ); trans.addStep( step2 ); StepMeta step3 = new StepMeta( "Step3", stepMetaInterface ); trans.addStep( step3 ); TransHopMeta hop1 = new TransHopMeta( input, step1, false ); TransHopMeta hop2 = new TransHopMeta( step1, step2, false ); TransHopMeta hop3 = new TransHopMeta( step2, step3, false ); trans.addTransHop( hop1 ); trans.addTransHop( hop2 ); trans.addTransHop( hop3 ); Transformation transformation = TransMetaConverter.convert( trans ); assertThat( "Trans has steps though all of them should be removed", transformation.getOperations().size(), is( 0 ) ); assertThat( "Trans has hops though all of them should be removed", transformation.getHops().size(), is( 0 ) ); }
public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); static final String TRANS_META_CONF_KEY; static final String TRANS_META_NAME_CONF_KEY; static final String SUB_TRANSFORMATIONS_KEY; static final String STEP_META_CONF_KEY; static final String TRANS_DEFAULT_NAME; }
@Test public void testTrimToType() { final String source = " trim me hard "; assertEquals( "trim me hard", Const.trimToType( source, ValueMetaInterface.TRIM_TYPE_BOTH ) ); assertEquals( "trim me hard ", Const.trimToType( source, ValueMetaInterface.TRIM_TYPE_LEFT ) ); assertEquals( " trim me hard", Const.trimToType( source, ValueMetaInterface.TRIM_TYPE_RIGHT ) ); assertEquals( source, Const.trimToType( source, ValueMetaInterface.TRIM_TYPE_NONE ) ); }
public static String trimToType( String string, int trimType ) { switch ( trimType ) { case ValueMetaInterface.TRIM_TYPE_BOTH: return trim( string ); case ValueMetaInterface.TRIM_TYPE_LEFT: return ltrim( string ); case ValueMetaInterface.TRIM_TYPE_RIGHT: return rtrim( string ); case ValueMetaInterface.TRIM_TYPE_NONE: default: return string; } }
Const { public static String trimToType( String string, int trimType ) { switch ( trimType ) { case ValueMetaInterface.TRIM_TYPE_BOTH: return trim( string ); case ValueMetaInterface.TRIM_TYPE_LEFT: return ltrim( string ); case ValueMetaInterface.TRIM_TYPE_RIGHT: return rtrim( string ); case ValueMetaInterface.TRIM_TYPE_NONE: default: return string; } } }
Const { public static String trimToType( String string, int trimType ) { switch ( trimType ) { case ValueMetaInterface.TRIM_TYPE_BOTH: return trim( string ); case ValueMetaInterface.TRIM_TYPE_LEFT: return ltrim( string ); case ValueMetaInterface.TRIM_TYPE_RIGHT: return rtrim( string ); case ValueMetaInterface.TRIM_TYPE_NONE: default: return string; } } }
Const { public static String trimToType( String string, int trimType ) { switch ( trimType ) { case ValueMetaInterface.TRIM_TYPE_BOTH: return trim( string ); case ValueMetaInterface.TRIM_TYPE_LEFT: return ltrim( string ); case ValueMetaInterface.TRIM_TYPE_RIGHT: return rtrim( string ); case ValueMetaInterface.TRIM_TYPE_NONE: default: return string; } } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String trimToType( String string, int trimType ) { switch ( trimType ) { case ValueMetaInterface.TRIM_TYPE_BOTH: return trim( string ); case ValueMetaInterface.TRIM_TYPE_LEFT: return ltrim( string ); case ValueMetaInterface.TRIM_TYPE_RIGHT: return rtrim( string ); case ValueMetaInterface.TRIM_TYPE_NONE: default: return string; } } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testSafeAppendDirectory() { final String expected = "dir" + Const.FILE_SEPARATOR + "file"; assertEquals( expected, Const.safeAppendDirectory( "dir", "file" ) ); assertEquals( expected, Const.safeAppendDirectory( "dir" + Const.FILE_SEPARATOR, "file" ) ); assertEquals( expected, Const.safeAppendDirectory( "dir", Const.FILE_SEPARATOR + "file" ) ); assertEquals( expected, Const.safeAppendDirectory( "dir" + Const.FILE_SEPARATOR, Const.FILE_SEPARATOR + "file" ) ); }
public static String safeAppendDirectory( String dir, String file ) { boolean dirHasSeparator = ( ( dir.lastIndexOf( FILE_SEPARATOR ) ) == dir.length() - 1 ); boolean fileHasSeparator = ( file.indexOf( FILE_SEPARATOR ) == 0 ); if ( ( dirHasSeparator && !fileHasSeparator ) || ( !dirHasSeparator && fileHasSeparator ) ) { return dir + file; } if ( dirHasSeparator && fileHasSeparator ) { return dir + file.substring( 1 ); } return dir + FILE_SEPARATOR + file; }
Const { public static String safeAppendDirectory( String dir, String file ) { boolean dirHasSeparator = ( ( dir.lastIndexOf( FILE_SEPARATOR ) ) == dir.length() - 1 ); boolean fileHasSeparator = ( file.indexOf( FILE_SEPARATOR ) == 0 ); if ( ( dirHasSeparator && !fileHasSeparator ) || ( !dirHasSeparator && fileHasSeparator ) ) { return dir + file; } if ( dirHasSeparator && fileHasSeparator ) { return dir + file.substring( 1 ); } return dir + FILE_SEPARATOR + file; } }
Const { public static String safeAppendDirectory( String dir, String file ) { boolean dirHasSeparator = ( ( dir.lastIndexOf( FILE_SEPARATOR ) ) == dir.length() - 1 ); boolean fileHasSeparator = ( file.indexOf( FILE_SEPARATOR ) == 0 ); if ( ( dirHasSeparator && !fileHasSeparator ) || ( !dirHasSeparator && fileHasSeparator ) ) { return dir + file; } if ( dirHasSeparator && fileHasSeparator ) { return dir + file.substring( 1 ); } return dir + FILE_SEPARATOR + file; } }
Const { public static String safeAppendDirectory( String dir, String file ) { boolean dirHasSeparator = ( ( dir.lastIndexOf( FILE_SEPARATOR ) ) == dir.length() - 1 ); boolean fileHasSeparator = ( file.indexOf( FILE_SEPARATOR ) == 0 ); if ( ( dirHasSeparator && !fileHasSeparator ) || ( !dirHasSeparator && fileHasSeparator ) ) { return dir + file; } if ( dirHasSeparator && fileHasSeparator ) { return dir + file.substring( 1 ); } return dir + FILE_SEPARATOR + file; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String safeAppendDirectory( String dir, String file ) { boolean dirHasSeparator = ( ( dir.lastIndexOf( FILE_SEPARATOR ) ) == dir.length() - 1 ); boolean fileHasSeparator = ( file.indexOf( FILE_SEPARATOR ) == 0 ); if ( ( dirHasSeparator && !fileHasSeparator ) || ( !dirHasSeparator && fileHasSeparator ) ) { return dir + file; } if ( dirHasSeparator && fileHasSeparator ) { return dir + file.substring( 1 ); } return dir + FILE_SEPARATOR + file; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetEmptyPaddedStrings() { final String[] strings = Const.getEmptyPaddedStrings(); for ( int i = 0; i < 250; i++ ) { assertEquals( i, strings[i].length() ); } }
public static String[] getEmptyPaddedStrings() { if ( emptyPaddedSpacesStrings == null ) { emptyPaddedSpacesStrings = new String[250]; for ( int i = 0; i < emptyPaddedSpacesStrings.length; i++ ) { emptyPaddedSpacesStrings[i] = rightPad( "", i ); } } return emptyPaddedSpacesStrings; }
Const { public static String[] getEmptyPaddedStrings() { if ( emptyPaddedSpacesStrings == null ) { emptyPaddedSpacesStrings = new String[250]; for ( int i = 0; i < emptyPaddedSpacesStrings.length; i++ ) { emptyPaddedSpacesStrings[i] = rightPad( "", i ); } } return emptyPaddedSpacesStrings; } }
Const { public static String[] getEmptyPaddedStrings() { if ( emptyPaddedSpacesStrings == null ) { emptyPaddedSpacesStrings = new String[250]; for ( int i = 0; i < emptyPaddedSpacesStrings.length; i++ ) { emptyPaddedSpacesStrings[i] = rightPad( "", i ); } } return emptyPaddedSpacesStrings; } }
Const { public static String[] getEmptyPaddedStrings() { if ( emptyPaddedSpacesStrings == null ) { emptyPaddedSpacesStrings = new String[250]; for ( int i = 0; i < emptyPaddedSpacesStrings.length; i++ ) { emptyPaddedSpacesStrings[i] = rightPad( "", i ); } } return emptyPaddedSpacesStrings; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String[] getEmptyPaddedStrings() { if ( emptyPaddedSpacesStrings == null ) { emptyPaddedSpacesStrings = new String[250]; for ( int i = 0; i < emptyPaddedSpacesStrings.length; i++ ) { emptyPaddedSpacesStrings[i] = rightPad( "", i ); } } return emptyPaddedSpacesStrings; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetPercentageFreeMemory() { assertTrue( Const.getPercentageFreeMemory() > 0 ); }
public static int getPercentageFreeMemory() { Runtime runtime = Runtime.getRuntime(); long maxMemory = runtime.maxMemory(); long allocatedMemory = runtime.totalMemory(); long freeMemory = runtime.freeMemory(); long totalFreeMemory = ( freeMemory + ( maxMemory - allocatedMemory ) ); return (int) Math.round( 100 * (double) totalFreeMemory / maxMemory ); }
Const { public static int getPercentageFreeMemory() { Runtime runtime = Runtime.getRuntime(); long maxMemory = runtime.maxMemory(); long allocatedMemory = runtime.totalMemory(); long freeMemory = runtime.freeMemory(); long totalFreeMemory = ( freeMemory + ( maxMemory - allocatedMemory ) ); return (int) Math.round( 100 * (double) totalFreeMemory / maxMemory ); } }
Const { public static int getPercentageFreeMemory() { Runtime runtime = Runtime.getRuntime(); long maxMemory = runtime.maxMemory(); long allocatedMemory = runtime.totalMemory(); long freeMemory = runtime.freeMemory(); long totalFreeMemory = ( freeMemory + ( maxMemory - allocatedMemory ) ); return (int) Math.round( 100 * (double) totalFreeMemory / maxMemory ); } }
Const { public static int getPercentageFreeMemory() { Runtime runtime = Runtime.getRuntime(); long maxMemory = runtime.maxMemory(); long allocatedMemory = runtime.totalMemory(); long freeMemory = runtime.freeMemory(); long totalFreeMemory = ( freeMemory + ( maxMemory - allocatedMemory ) ); return (int) Math.round( 100 * (double) totalFreeMemory / maxMemory ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static int getPercentageFreeMemory() { Runtime runtime = Runtime.getRuntime(); long maxMemory = runtime.maxMemory(); long allocatedMemory = runtime.totalMemory(); long freeMemory = runtime.freeMemory(); long totalFreeMemory = ( freeMemory + ( maxMemory - allocatedMemory ) ); return (int) Math.round( 100 * (double) totalFreeMemory / maxMemory ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testRemoveDigits() { assertNull( Const.removeDigits( null ) ); assertEquals( "foobar", Const.removeDigits( "123foo456bar789" ) ); }
public static String removeDigits( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( !Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString(); }
Const { public static String removeDigits( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( !Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString(); } }
Const { public static String removeDigits( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( !Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString(); } }
Const { public static String removeDigits( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( !Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String removeDigits( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( !Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetDigitsOnly() { assertNull( Const.removeDigits( null ) ); assertEquals( "123456789", Const.getDigitsOnly( "123foo456bar789" ) ); }
public static String getDigitsOnly( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString(); }
Const { public static String getDigitsOnly( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString(); } }
Const { public static String getDigitsOnly( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString(); } }
Const { public static String getDigitsOnly( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String getDigitsOnly( String input ) { if ( Utils.isEmpty( input ) ) { return null; } StringBuilder digitsOnly = new StringBuilder(); char c; for ( int i = 0; i < input.length(); i++ ) { c = input.charAt( i ); if ( Character.isDigit( c ) ) { digitsOnly.append( c ); } } return digitsOnly.toString(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testRemoveTimeFromDate() { final Date date = Const.removeTimeFromDate( new Date() ); assertEquals( 0, date.getHours() ); assertEquals( 0, date.getMinutes() ); assertEquals( 0, date.getSeconds() ); }
public static Date removeTimeFromDate( Date input ) { if ( input == null ) { return null; } Calendar calendar = Calendar.getInstance(); calendar.setLenient( false ); calendar.setTime( input ); calendar.set( Calendar.HOUR_OF_DAY, 0 ); calendar.set( Calendar.MINUTE, 0 ); calendar.set( Calendar.SECOND, 0 ); calendar.set( Calendar.MILLISECOND, 0 ); return calendar.getTime(); }
Const { public static Date removeTimeFromDate( Date input ) { if ( input == null ) { return null; } Calendar calendar = Calendar.getInstance(); calendar.setLenient( false ); calendar.setTime( input ); calendar.set( Calendar.HOUR_OF_DAY, 0 ); calendar.set( Calendar.MINUTE, 0 ); calendar.set( Calendar.SECOND, 0 ); calendar.set( Calendar.MILLISECOND, 0 ); return calendar.getTime(); } }
Const { public static Date removeTimeFromDate( Date input ) { if ( input == null ) { return null; } Calendar calendar = Calendar.getInstance(); calendar.setLenient( false ); calendar.setTime( input ); calendar.set( Calendar.HOUR_OF_DAY, 0 ); calendar.set( Calendar.MINUTE, 0 ); calendar.set( Calendar.SECOND, 0 ); calendar.set( Calendar.MILLISECOND, 0 ); return calendar.getTime(); } }
Const { public static Date removeTimeFromDate( Date input ) { if ( input == null ) { return null; } Calendar calendar = Calendar.getInstance(); calendar.setLenient( false ); calendar.setTime( input ); calendar.set( Calendar.HOUR_OF_DAY, 0 ); calendar.set( Calendar.MINUTE, 0 ); calendar.set( Calendar.SECOND, 0 ); calendar.set( Calendar.MILLISECOND, 0 ); return calendar.getTime(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static Date removeTimeFromDate( Date input ) { if ( input == null ) { return null; } Calendar calendar = Calendar.getInstance(); calendar.setLenient( false ); calendar.setTime( input ); calendar.set( Calendar.HOUR_OF_DAY, 0 ); calendar.set( Calendar.MINUTE, 0 ); calendar.set( Calendar.SECOND, 0 ); calendar.set( Calendar.MILLISECOND, 0 ); return calendar.getTime(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testEscapeSQL() { assertEquals( "SELECT ''Let''s rock!'' FROM dual", Const.escapeSQL( "SELECT 'Let's rock!' FROM dual" ) ); }
public static String escapeSQL( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeSql( content ); }
Const { public static String escapeSQL( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeSql( content ); } }
Const { public static String escapeSQL( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeSql( content ); } }
Const { public static String escapeSQL( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeSql( content ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String escapeSQL( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeSql( content ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testRemoveCRLF() { assertEquals( "foo\tbar", Const.removeCRLF( "foo\r\n\tbar" ) ); assertEquals( "", Const.removeCRLF( "" ) ); assertEquals( "", Const.removeCRLF( null ) ); assertEquals( "", Const.removeCRLF( "\r\n" ) ); assertEquals( "This is a test of the emergency broadcast system", Const.removeCRLF( "This \r\nis \ra \ntest \rof \n\rthe \r\nemergency \rbroadcast \nsystem\r\n" ) ); }
public static String removeCRLF( String in ) { if ( ( in != null ) && ( in.length() > 0 ) ) { int inLen = in.length(), posn = 0; char[] tmp = new char[ inLen ]; char ch; for ( int i = 0; i < inLen; i++ ) { ch = in.charAt( i ); if ( ( ch != '\n' && ch != '\r' ) ) { tmp[posn] = ch; posn++; } } return new String( tmp, 0, posn ); } else { return ""; } }
Const { public static String removeCRLF( String in ) { if ( ( in != null ) && ( in.length() > 0 ) ) { int inLen = in.length(), posn = 0; char[] tmp = new char[ inLen ]; char ch; for ( int i = 0; i < inLen; i++ ) { ch = in.charAt( i ); if ( ( ch != '\n' && ch != '\r' ) ) { tmp[posn] = ch; posn++; } } return new String( tmp, 0, posn ); } else { return ""; } } }
Const { public static String removeCRLF( String in ) { if ( ( in != null ) && ( in.length() > 0 ) ) { int inLen = in.length(), posn = 0; char[] tmp = new char[ inLen ]; char ch; for ( int i = 0; i < inLen; i++ ) { ch = in.charAt( i ); if ( ( ch != '\n' && ch != '\r' ) ) { tmp[posn] = ch; posn++; } } return new String( tmp, 0, posn ); } else { return ""; } } }
Const { public static String removeCRLF( String in ) { if ( ( in != null ) && ( in.length() > 0 ) ) { int inLen = in.length(), posn = 0; char[] tmp = new char[ inLen ]; char ch; for ( int i = 0; i < inLen; i++ ) { ch = in.charAt( i ); if ( ( ch != '\n' && ch != '\r' ) ) { tmp[posn] = ch; posn++; } } return new String( tmp, 0, posn ); } else { return ""; } } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String removeCRLF( String in ) { if ( ( in != null ) && ( in.length() > 0 ) ) { int inLen = in.length(), posn = 0; char[] tmp = new char[ inLen ]; char ch; for ( int i = 0; i < inLen; i++ ) { ch = in.charAt( i ); if ( ( ch != '\n' && ch != '\r' ) ) { tmp[posn] = ch; posn++; } } return new String( tmp, 0, posn ); } else { return ""; } } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testRemoveCR() { assertEquals( "foo\r\tbar", Const.removeCR( "foo\r\n\tbar" ) ); assertEquals( "", Const.removeCR( "" ) ); assertEquals( "", Const.removeCR( null ) ); assertEquals( "", Const.removeCR( "\n" ) ); assertEquals( "\r", Const.removeCR( "\n\r\n" ) ); assertEquals( "This \ris \ra test \rof \rthe \remergency \rbroadcast system\r", Const.removeCR( "This \r\nis \ra \ntest \rof \n\rthe \r\nemergency \rbroadcast \nsystem\r\n" ) ); }
public static String removeCR( String in ) { return removeChar( in, '\n' ); }
Const { public static String removeCR( String in ) { return removeChar( in, '\n' ); } }
Const { public static String removeCR( String in ) { return removeChar( in, '\n' ); } }
Const { public static String removeCR( String in ) { return removeChar( in, '\n' ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String removeCR( String in ) { return removeChar( in, '\n' ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void errorHops() throws Exception { TransMeta meta = new TransMeta(); meta.setFilename( "fileName" ); StepMeta from = new StepMeta( "step1", stepMetaInterface ); meta.addStep( from ); StepMeta to = new StepMeta( "step2", stepMetaInterface ); meta.addStep( to ); meta.addTransHop( new TransHopMeta( from, to ) ); StepMeta error = new StepMeta( "errorHandler", stepMetaInterface ); meta.addStep( error ); TransHopMeta errorHop = new TransHopMeta( from, error ); errorHop.setErrorHop( true ); meta.addTransHop( errorHop ); Transformation trans = TransMetaConverter.convert( meta ); Map<String, List<Hop>> hops = trans.getHops().stream().collect( Collectors.groupingBy( Hop::getType ) ); List<Hop> normalHops = hops.get( Hop.TYPE_NORMAL ); assertThat( normalHops.size(), is( 1 ) ); assertThat( normalHops.get( 0 ).getTo().getId(), is( "step2" ) ); List<Hop> errorHops = hops.get( Hop.TYPE_ERROR ); assertThat( errorHops.size(), is( 1 ) ); assertThat( errorHops.get( 0 ).getTo().getId(), is( "errorHandler" ) ); assertThat( hops.values().stream() .flatMap( List::stream ) .map( Hop::getFrom ).map( Operation::getId ) .collect( Collectors.toList() ), everyItem( equalTo( "step1" ) ) ); }
public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); static final String TRANS_META_CONF_KEY; static final String TRANS_META_NAME_CONF_KEY; static final String SUB_TRANSFORMATIONS_KEY; static final String STEP_META_CONF_KEY; static final String TRANS_DEFAULT_NAME; }
@Test public void testRemoveLF() { assertEquals( "foo\n\tbar", Const.removeLF( "foo\r\n\tbar" ) ); assertEquals( "", Const.removeLF( "" ) ); assertEquals( "", Const.removeLF( null ) ); assertEquals( "", Const.removeLF( "\r" ) ); assertEquals( "\n", Const.removeLF( "\r\n\r" ) ); assertEquals( "This \nis a \ntest of \nthe \nemergency broadcast \nsystem\n", Const.removeLF( "This \r\nis \ra \ntest \rof \n\rthe \r\nemergency \rbroadcast \nsystem\r\n" ) ); }
public static String removeLF( String in ) { return removeChar( in, '\r' ); }
Const { public static String removeLF( String in ) { return removeChar( in, '\r' ); } }
Const { public static String removeLF( String in ) { return removeChar( in, '\r' ); } }
Const { public static String removeLF( String in ) { return removeChar( in, '\r' ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String removeLF( String in ) { return removeChar( in, '\r' ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testRemoveTAB() { assertEquals( "foo\r\nbar", Const.removeTAB( "foo\r\n\tbar" ) ); assertEquals( "", Const.removeTAB( "" ) ); assertEquals( "", Const.removeTAB( null ) ); assertEquals( "", Const.removeTAB( "\t" ) ); assertEquals( "\r", Const.removeTAB( "\t\r\t" ) ); assertEquals( "Thisisatest", Const.removeTAB( "\tThis\tis\ta\ttest" ) ); }
public static String removeTAB( String in ) { return removeChar( in, '\t' ); }
Const { public static String removeTAB( String in ) { return removeChar( in, '\t' ); } }
Const { public static String removeTAB( String in ) { return removeChar( in, '\t' ); } }
Const { public static String removeTAB( String in ) { return removeChar( in, '\t' ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String removeTAB( String in ) { return removeChar( in, '\t' ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testAddTimeToDate() throws Exception { final Date date = new Date( 1447252914241L ); assertNull( Const.addTimeToDate( null, null, null ) ); assertEquals( date, Const.addTimeToDate( date, null, null ) ); assertEquals( 1447256637241L, Const.addTimeToDate( date, "01:02:03", "HH:mm:ss" ).getTime() ); }
public static Date addTimeToDate( Date input, String time, String DateFormat ) throws Exception { if ( Utils.isEmpty( time ) ) { return input; } if ( input == null ) { return null; } String dateformatString = NVL( DateFormat, "HH:mm:ss" ); int t = decodeTime( time, dateformatString ); return new Date( input.getTime() + t ); }
Const { public static Date addTimeToDate( Date input, String time, String DateFormat ) throws Exception { if ( Utils.isEmpty( time ) ) { return input; } if ( input == null ) { return null; } String dateformatString = NVL( DateFormat, "HH:mm:ss" ); int t = decodeTime( time, dateformatString ); return new Date( input.getTime() + t ); } }
Const { public static Date addTimeToDate( Date input, String time, String DateFormat ) throws Exception { if ( Utils.isEmpty( time ) ) { return input; } if ( input == null ) { return null; } String dateformatString = NVL( DateFormat, "HH:mm:ss" ); int t = decodeTime( time, dateformatString ); return new Date( input.getTime() + t ); } }
Const { public static Date addTimeToDate( Date input, String time, String DateFormat ) throws Exception { if ( Utils.isEmpty( time ) ) { return input; } if ( input == null ) { return null; } String dateformatString = NVL( DateFormat, "HH:mm:ss" ); int t = decodeTime( time, dateformatString ); return new Date( input.getTime() + t ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static Date addTimeToDate( Date input, String time, String DateFormat ) throws Exception { if ( Utils.isEmpty( time ) ) { return input; } if ( input == null ) { return null; } String dateformatString = NVL( DateFormat, "HH:mm:ss" ); int t = decodeTime( time, dateformatString ); return new Date( input.getTime() + t ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetOccurenceString() { assertEquals( 0, Const.getOccurenceString( "", "" ) ); assertEquals( 0, Const.getOccurenceString( "foo bar bazfoo", "cat" ) ); assertEquals( 2, Const.getOccurenceString( "foo bar bazfoo", "foo" ) ); }
public static int getOccurenceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } int counter = 0; int len = searchFor.length(); if ( len > 0 ) { int start = string.indexOf( searchFor ); while ( start != -1 ) { counter++; start = string.indexOf( searchFor, start + len ); } } return counter; }
Const { public static int getOccurenceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } int counter = 0; int len = searchFor.length(); if ( len > 0 ) { int start = string.indexOf( searchFor ); while ( start != -1 ) { counter++; start = string.indexOf( searchFor, start + len ); } } return counter; } }
Const { public static int getOccurenceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } int counter = 0; int len = searchFor.length(); if ( len > 0 ) { int start = string.indexOf( searchFor ); while ( start != -1 ) { counter++; start = string.indexOf( searchFor, start + len ); } } return counter; } }
Const { public static int getOccurenceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } int counter = 0; int len = searchFor.length(); if ( len > 0 ) { int start = string.indexOf( searchFor ); while ( start != -1 ) { counter++; start = string.indexOf( searchFor, start + len ); } } return counter; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static int getOccurenceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } int counter = 0; int len = searchFor.length(); if ( len > 0 ) { int start = string.indexOf( searchFor ); while ( start != -1 ) { counter++; start = string.indexOf( searchFor, start + len ); } } return counter; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetAvailableFontNames() { assertTrue( Const.GetAvailableFontNames().length > 0 ); }
public static String[] GetAvailableFontNames() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Font[] fonts = ge.getAllFonts(); String[] FontName = new String[fonts.length]; for ( int i = 0; i < fonts.length; i++ ) { FontName[i] = fonts[i].getFontName(); } return FontName; }
Const { public static String[] GetAvailableFontNames() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Font[] fonts = ge.getAllFonts(); String[] FontName = new String[fonts.length]; for ( int i = 0; i < fonts.length; i++ ) { FontName[i] = fonts[i].getFontName(); } return FontName; } }
Const { public static String[] GetAvailableFontNames() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Font[] fonts = ge.getAllFonts(); String[] FontName = new String[fonts.length]; for ( int i = 0; i < fonts.length; i++ ) { FontName[i] = fonts[i].getFontName(); } return FontName; } }
Const { public static String[] GetAvailableFontNames() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Font[] fonts = ge.getAllFonts(); String[] FontName = new String[fonts.length]; for ( int i = 0; i < fonts.length; i++ ) { FontName[i] = fonts[i].getFontName(); } return FontName; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String[] GetAvailableFontNames() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Font[] fonts = ge.getAllFonts(); String[] FontName = new String[fonts.length]; for ( int i = 0; i < fonts.length; i++ ) { FontName[i] = fonts[i].getFontName(); } return FontName; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetKettlePropertiesFileHeader() { assertFalse( Const.getKettlePropertiesFileHeader().isEmpty() ); }
public static String getKettlePropertiesFileHeader() { StringBuilder out = new StringBuilder(); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line01", BuildVersion .getInstance().getVersion() ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line02" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line03" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line04" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line05" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line06" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line07" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line08" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line09" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line10" ) + CR ); return out.toString(); }
Const { public static String getKettlePropertiesFileHeader() { StringBuilder out = new StringBuilder(); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line01", BuildVersion .getInstance().getVersion() ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line02" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line03" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line04" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line05" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line06" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line07" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line08" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line09" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line10" ) + CR ); return out.toString(); } }
Const { public static String getKettlePropertiesFileHeader() { StringBuilder out = new StringBuilder(); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line01", BuildVersion .getInstance().getVersion() ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line02" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line03" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line04" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line05" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line06" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line07" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line08" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line09" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line10" ) + CR ); return out.toString(); } }
Const { public static String getKettlePropertiesFileHeader() { StringBuilder out = new StringBuilder(); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line01", BuildVersion .getInstance().getVersion() ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line02" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line03" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line04" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line05" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line06" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line07" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line08" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line09" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line10" ) + CR ); return out.toString(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String getKettlePropertiesFileHeader() { StringBuilder out = new StringBuilder(); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line01", BuildVersion .getInstance().getVersion() ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line02" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line03" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line04" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line05" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line06" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line07" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line08" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line09" ) + CR ); out.append( BaseMessages.getString( PKG, "Props.Kettle.Properties.Sample.Line10" ) + CR ); return out.toString(); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testProtectXMLCDATA() { assertEquals( null, Const.protectXMLCDATA( null ) ); assertEquals( "", Const.protectXMLCDATA( "" ) ); assertEquals( "<![CDATA[foo]]>", Const.protectXMLCDATA( "foo" ) ); }
public static String protectXMLCDATA( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return "<![CDATA[" + content + "]]>"; }
Const { public static String protectXMLCDATA( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return "<![CDATA[" + content + "]]>"; } }
Const { public static String protectXMLCDATA( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return "<![CDATA[" + content + "]]>"; } }
Const { public static String protectXMLCDATA( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return "<![CDATA[" + content + "]]>"; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String protectXMLCDATA( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return "<![CDATA[" + content + "]]>"; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testGetOcuranceString() { assertEquals( 0, Const.getOcuranceString( "", "" ) ); assertEquals( 0, Const.getOcuranceString( "foo bar bazfoo", "cat" ) ); assertEquals( 2, Const.getOcuranceString( "foo bar bazfoo", "foo" ) ); }
public static int getOcuranceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } Pattern p = Pattern.compile( searchFor ); Matcher m = p.matcher( string ); int count = 0; while ( m.find() ) { ++count; } return count; }
Const { public static int getOcuranceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } Pattern p = Pattern.compile( searchFor ); Matcher m = p.matcher( string ); int count = 0; while ( m.find() ) { ++count; } return count; } }
Const { public static int getOcuranceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } Pattern p = Pattern.compile( searchFor ); Matcher m = p.matcher( string ); int count = 0; while ( m.find() ) { ++count; } return count; } }
Const { public static int getOcuranceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } Pattern p = Pattern.compile( searchFor ); Matcher m = p.matcher( string ); int count = 0; while ( m.find() ) { ++count; } return count; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static int getOcuranceString( String string, String searchFor ) { if ( string == null || string.length() == 0 ) { return 0; } Pattern p = Pattern.compile( searchFor ); Matcher m = p.matcher( string ); int count = 0; while ( m.find() ) { ++count; } return count; } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testEscapeXml() { final String xml = "<xml xmlns:test=\"http: final String escaped = "&lt;xml xmlns:test=&quot;http: assertNull( Const.escapeXml( null ) ); assertEquals( escaped, Const.escapeXml( xml ) ); }
public static String escapeXML( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeXml( content ); }
Const { public static String escapeXML( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeXml( content ); } }
Const { public static String escapeXML( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeXml( content ); } }
Const { public static String escapeXML( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeXml( content ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String escapeXML( String content ) { if ( Utils.isEmpty( content ) ) { return content; } return StringEscapeUtils.escapeXml( content ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testLpad() { final String s = "pad me"; assertEquals( s, Const.Lpad( s, "-", 0 ) ); assertEquals( s, Const.Lpad( s, "-", 3 ) ); assertEquals( "--" + s, Const.Lpad( s, "-", 8 ) ); assertEquals( s, Const.Lpad( s, null, 15 ) ); assertEquals( s, Const.Lpad( s, "", 15 ) ); assertEquals( s, Const.Lpad( s, "*", 5 ) ); assertEquals( null, Const.Lpad( null, "*", 15 ) ); assertEquals( "****Test", Const.Lpad( "Test", "**********", 8 ) ); assertEquals( "*Test", Const.Lpad( "Test", "**", 5 ) ); assertEquals( "****", Const.Lpad( "", "*", 4 ) ); }
public static String Lpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size - vSize ); StringBuilder sb = new StringBuilder( size ); sb.append( filler ); while ( sb.length() < tgt ) { sb.append( sb ); } sb.append( valueToPad ); return sb.substring( Math.max( 0, sb.length() - size ) ); }
Const { public static String Lpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size - vSize ); StringBuilder sb = new StringBuilder( size ); sb.append( filler ); while ( sb.length() < tgt ) { sb.append( sb ); } sb.append( valueToPad ); return sb.substring( Math.max( 0, sb.length() - size ) ); } }
Const { public static String Lpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size - vSize ); StringBuilder sb = new StringBuilder( size ); sb.append( filler ); while ( sb.length() < tgt ) { sb.append( sb ); } sb.append( valueToPad ); return sb.substring( Math.max( 0, sb.length() - size ) ); } }
Const { public static String Lpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size - vSize ); StringBuilder sb = new StringBuilder( size ); sb.append( filler ); while ( sb.length() < tgt ) { sb.append( sb ); } sb.append( valueToPad ); return sb.substring( Math.max( 0, sb.length() - size ) ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String Lpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size - vSize ); StringBuilder sb = new StringBuilder( size ); sb.append( filler ); while ( sb.length() < tgt ) { sb.append( sb ); } sb.append( valueToPad ); return sb.substring( Math.max( 0, sb.length() - size ) ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void lazyConversionTurnedOff() throws KettleException { KettleEnvironment.init(); TransMeta transMeta = new TransMeta(); CsvInputMeta csvInputMeta = new CsvInputMeta(); csvInputMeta.setLazyConversionActive( true ); StepMeta csvInput = new StepMeta( "Csv", csvInputMeta ); transMeta.addStep( csvInput ); TableInputMeta tableInputMeta = new TableInputMeta(); tableInputMeta.setLazyConversionActive( true ); StepMeta tableInput = new StepMeta( "Table", tableInputMeta ); transMeta.addStep( tableInput ); Transformation trans = TransMetaConverter.convert( transMeta ); TransMeta cloneMeta; String transMetaXml = (String) trans.getConfig().get( TransMetaConverter.TRANS_META_CONF_KEY ); Document doc; try { doc = XMLHandler.loadXMLString( transMetaXml ); Node stepNode = XMLHandler.getSubNode( doc, "transformation" ); cloneMeta = new TransMeta( stepNode, null ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } assertThat( ( (CsvInputMeta) cloneMeta.findStep( "Csv" ).getStepMetaInterface() ).isLazyConversionActive(), is( false ) ); assertThat( ( (TableInputMeta) cloneMeta.findStep( "Table" ).getStepMetaInterface() ).isLazyConversionActive(), is( false ) ); }
public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); static final String TRANS_META_CONF_KEY; static final String TRANS_META_NAME_CONF_KEY; static final String SUB_TRANSFORMATIONS_KEY; static final String STEP_META_CONF_KEY; static final String TRANS_DEFAULT_NAME; }
@Test public void testRpad() { final String s = "pad me"; assertEquals( s, Const.Rpad( s, "-", 0 ) ); assertEquals( s, Const.Rpad( s, "-", 3 ) ); assertEquals( s + "--", Const.Rpad( s, "-", 8 ) ); assertEquals( s, Const.Rpad( s, null, 15 ) ); assertEquals( s, Const.Rpad( s, "", 15 ) ); assertEquals( s, Const.Rpad( s, "*", 5 ) ); assertEquals( null, Const.Rpad( null, "*", 15 ) ); assertEquals( "Test****", Const.Rpad( "Test", "**********", 8 ) ); assertEquals( "Test*", Const.Rpad( "Test", "**", 5 ) ); assertEquals( "****", Const.Rpad( "", "*", 4 ) ); }
public static String Rpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size - vSize ); StringBuilder sb1 = new StringBuilder( size ); sb1.append( filler ); while ( sb1.length() < tgt ) { sb1.append( sb1 ); } StringBuilder sb = new StringBuilder( valueToPad ); sb.append( sb1 ); return sb.substring( 0, size ); }
Const { public static String Rpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size - vSize ); StringBuilder sb1 = new StringBuilder( size ); sb1.append( filler ); while ( sb1.length() < tgt ) { sb1.append( sb1 ); } StringBuilder sb = new StringBuilder( valueToPad ); sb.append( sb1 ); return sb.substring( 0, size ); } }
Const { public static String Rpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size - vSize ); StringBuilder sb1 = new StringBuilder( size ); sb1.append( filler ); while ( sb1.length() < tgt ) { sb1.append( sb1 ); } StringBuilder sb = new StringBuilder( valueToPad ); sb.append( sb1 ); return sb.substring( 0, size ); } }
Const { public static String Rpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size - vSize ); StringBuilder sb1 = new StringBuilder( size ); sb1.append( filler ); while ( sb1.length() < tgt ) { sb1.append( sb1 ); } StringBuilder sb = new StringBuilder( valueToPad ); sb.append( sb1 ); return sb.substring( 0, size ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static String Rpad( String valueToPad, String filler, int size ) { if ( ( size == 0 ) || ( valueToPad == null ) || ( filler == null ) ) { return valueToPad; } int vSize = valueToPad.length(); int fSize = filler.length(); if ( ( vSize >= size ) || ( fSize == 0 ) ) { return valueToPad; } int tgt = ( size - vSize ); StringBuilder sb1 = new StringBuilder( size ); sb1.append( filler ); while ( sb1.length() < tgt ) { sb1.append( sb1 ); } StringBuilder sb = new StringBuilder( valueToPad ); sb.append( sb1 ); return sb.substring( 0, size ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testClassIsOrExtends() { assertFalse( Const.classIsOrExtends( Object.class, Object.class ) ); assertTrue( Const.classIsOrExtends( String.class, String.class ) ); assertTrue( Const.classIsOrExtends( ArrayList.class, ArrayList.class ) ); }
public static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ) { if ( clazz.equals( Object.class ) ) { return false; } return clazz.equals( superClass ) || classIsOrExtends( clazz.getSuperclass(), superClass ); }
Const { public static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ) { if ( clazz.equals( Object.class ) ) { return false; } return clazz.equals( superClass ) || classIsOrExtends( clazz.getSuperclass(), superClass ); } }
Const { public static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ) { if ( clazz.equals( Object.class ) ) { return false; } return clazz.equals( superClass ) || classIsOrExtends( clazz.getSuperclass(), superClass ); } }
Const { public static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ) { if ( clazz.equals( Object.class ) ) { return false; } return clazz.equals( superClass ) || classIsOrExtends( clazz.getSuperclass(), superClass ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { public static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ) { if ( clazz.equals( Object.class ) ) { return false; } return clazz.equals( superClass ) || classIsOrExtends( clazz.getSuperclass(), superClass ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void testReleaseType() { for ( Const.ReleaseType type : Const.ReleaseType.values() ) { assertFalse( type.getMessage().isEmpty() ); } }
@Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); }
Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } }
Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } }
Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); }
Const { @Deprecated public static boolean isEmpty( String val ) { return Utils.isEmpty( val ); } static double round( double f, int places ); static double round( double f, int places, int roundingMode ); static BigDecimal round( BigDecimal f, int places, int roundingMode ); static long round( long f, int places, int roundingMode ); static int toInt( String str, int def ); static long toLong( String str, long def ); static double toDouble( String str, double def ); static Date toDate( String str, Date def ); static boolean isSpace( char c ); static String ltrim( String source ); static String rtrim( String source ); static String trim( String str ); static String rightPad( String ret, int limit ); static String rightPad( StringBuffer ret, int limit ); static String rightPad( StringBuilder ret, int limit ); static String replace( String string, String repl, String with ); static void repl( StringBuffer str, String code, String repl ); static void repl( StringBuilder str, String code, String repl ); static int nrSpacesBefore( String field ); static int nrSpacesAfter( String field ); static boolean onlySpaces( String str ); static String getOS(); static String getQuoteCharByOS(); static String optionallyQuoteStringByOS( String string ); static boolean isWindows(); static boolean isLinux(); static boolean isOSX(); static boolean isKDE(); static String getHostname(); static String getHostnameReal(); static String getIPAddress(); static String getIPAddress( String networkInterfaceName ); static String getMACAddress(); static String getUserHomeDirectory(); static String getKettleDirectory(); static String getUserBaseDir(); static String getDIHomeDirectory(); static String getSharedObjectsFile(); static String getKettleLocalRepositoriesFile(); static String getKettleUserRepositoriesFile(); static String getKettleLocalCartePasswordFile(); static String getKettleCartePasswordFile(); static String getBaseDocUrl(); static String getDocUrl( final String uri ); static String getEnvironmentVariable( String variable, String deflt ); @Deprecated static String replEnv( String string ); @Deprecated static String[] replEnv( String[] string ); static String NVL( String source, String def ); static String nullToEmpty( String source ); static int indexOfString( String lookup, String[] array ); static int[] indexsOfStrings( String[] lookup, String[] array ); static int[] indexsOfFoundStrings( String[] lookup, String[] array ); static int indexOfString( String lookup, List<String> list ); static String[] sortStrings( String[] input ); static String[] splitString( String string, String separator ); static String[] splitString( String string, char separator ); static String[] splitString( String string, char separator, boolean escape ); static String[] splitPath( String path, String separator ); static String[] splitString( String stringToSplit, String delimiter, String enclosure ); static String[] splitString( String stringToSplit, String delimiter, String enclosure, boolean removeEnclosure ); static String[] getDistinctStrings( String[] strings ); static String getStackTracker( Throwable e ); static String getClassicStackTrace( Throwable e ); static String getCustomStackTrace( Throwable aThrowable ); @Deprecated static boolean isEmpty( String val ); @Deprecated static boolean isEmpty( StringBuffer val ); @Deprecated static boolean isEmpty( String[] vals ); @Deprecated static boolean isEmpty( CharSequence val ); @Deprecated static boolean isEmpty( CharSequence[] vals ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static boolean isEmpty( List<?> list ); static ClassLoader createNewClassLoader(); static byte[] createByteArray( int size ); static String initCap( String string ); static String createFilename( String name ); static String createFilename( String directory, String name, String extension ); static String createName( String filename ); static String filenameOnly( String sFullPath ); static String[] getDateFormats(); static String[] getNumberFormats(); static String[] getConversionFormats(); static String[] getTransformationAndJobFilterNames(); static String[] getTransformationFilterNames(); static String[] getJobFilterNames(); static long nanoTime(); static String trimToType( String string, int trimType ); static String safeAppendDirectory( String dir, String file ); static String[] getEmptyPaddedStrings(); static int getPercentageFreeMemory(); static String removeDigits( String input ); static String getDigitsOnly( String input ); static Date removeTimeFromDate( Date input ); static String escapeXML( String content ); static String escapeHtml( String content ); static String unEscapeHtml( String content ); static String unEscapeXml( String content ); static String escapeSQL( String content ); static String removeCRLF( String in ); static String removeChar( String in, char badChar ); static String removeCR( String in ); static String removeLF( String in ); static String removeTAB( String in ); static Date addTimeToDate( Date input, String time, String DateFormat ); static int decodeTime( String s, String DateFormat ); static int getOccurenceString( String string, String searchFor ); static String[] GetAvailableFontNames(); static String getKettlePropertiesFileHeader(); static String protectXMLCDATA( String content ); static int getOcuranceString( String string, String searchFor ); static String escapeXml( String content ); static String Lpad( String valueToPad, String filler, int size ); static String Rpad( String valueToPad, String filler, int size ); static boolean classIsOrExtends( Class<?> clazz, Class<?> superClass ); static String getDeprecatedPrefix(); @Deprecated static final String VERSION; static final String COPYRIGHT_YEAR; static final int TIMEOUT_GET_MILLIS; static final int TIMEOUT_PUT_MILLIS; static final int ROWS_UPDATE; static final int ROWS_IN_ROWSET; static final int FETCH_SIZE; static final int SORT_SIZE; static final int HEARTBEAT_PERIODIC_INTERVAL_IN_SECS; static final String FILE_SEPARATOR; static final String PATH_SEPARATOR; static final String CR; static final String DOSCR; static final String EMPTY_STRING; static final String JAVA_VERSION; @Deprecated static final String USER_HOME_DIRECTORY; static String JNDI_DIRECTORY; static final String PLUGIN_BASE_FOLDERS_PROP; static final String DEFAULT_PLUGIN_BASE_FOLDERS; static final Date MIN_DATE; static final Date MAX_DATE; static final int MIN_YEAR; static final int MAX_YEAR; static final int RIGHT; static final int LENGTH; static final int MARGIN; static final int MIDDLE_PCT; static final int ARROW_WIDTH; static final int FORM_MARGIN; static final int SHADOW_SIZE; static final int SYMBOLSIZE; static final int MAX_FILE_HIST; static final Locale DEFAULT_LOCALE; static final char DEFAULT_DECIMAL_SEPARATOR; static final char DEFAULT_GROUPING_SEPARATOR; static final String DEFAULT_CURRENCY_SYMBOL; static final String DEFAULT_NUMBER_FORMAT; static final String NULL_STRING; static final String NULL_NUMBER; static final String NULL_DATE; static final String NULL_BIGNUMBER; static final String NULL_BOOLEAN; static final String NULL_INTEGER; static final String NULL_BINARY; static final String NULL_NONE; static final int ROUND_HALF_CEILING; static final String CHEF_LOG_FILE; static final String SPOON_LOG_FILE; static final String MENU_LOG_FILE; static final String GENERALIZED_DATE_TIME_FORMAT; static final String GENERALIZED_DATE_TIME_FORMAT_MILLIS; static final String XML_ENCODING; static final String[] STRING_TRANS_AND_JOB_FILTER_EXT; static final String STRING_TRANS_DEFAULT_EXT; static final String[] STRING_TRANS_FILTER_EXT; static final String STRING_JOB_DEFAULT_EXT; static final String[] STRING_JOB_FILTER_EXT; static final String KETTLE_PROPERTIES; static final String SHARED_DATA_FILE; static final String INTERNAL_VARIABLE_PREFIX; static final String INTERNAL_VARIABLE_KETTLE_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_VERSION; static final String INTERNAL_VARIABLE_KETTLE_BUILD_DATE; static final String INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_FILENAME_NAME; static final String INTERNAL_VARIABLE_JOB_NAME; static final String INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_JOB_RUN_ID; static final String INTERNAL_VARIABLE_JOB_RUN_ATTEMPTNR; static final String VARIABLE_HEARTBEAT_PERIODIC_INTERVAL_SECS; static final String VARIABLE_MONITORING_SNMP_TRAPS_ENABLED; static final String INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY; static final String[] INTERNAL_TRANS_VARIABLES; static final String[] INTERNAL_JOB_VARIABLES; static final String[] DEPRECATED_VARIABLES; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY; static final String INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_NAME; static final String INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY; static final String INTERNAL_VARIABLE_STEP_PARTITION_ID; static final String INTERNAL_VARIABLE_STEP_PARTITION_NR; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER; static final String INTERNAL_VARIABLE_SLAVE_SERVER_NAME; static final String INTERNAL_VARIABLE_CLUSTER_SIZE; static final String INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER; static final String INTERNAL_VARIABLE_CLUSTER_MASTER; static final String INTERNAL_VARIABLE_CLUSTER_RUN_ID; static final String INTERNAL_VARIABLE_STEP_UNIQUE_COUNT; static final String INTERNAL_VARIABLE_STEP_NAME; static final String INTERNAL_VARIABLE_STEP_COPYNR; static final int MAX_NR_LOG_LINES; static final int MAX_NR_HISTORY_LINES; static final int HISTORY_LINES_FETCH_SIZE; static final int MAX_LOG_LINE_TIMEOUT_MINUTES; static final int WARNING; static final int ERROR; static final int INFO; static final int NOTE_MARGIN; static final int MAX_UNDO; static final String KETTLE_VARIABLES_FILE; static final String KETTLE_LOG_SIZE_LIMIT; static final String KETTLE_TRANS_LOG_DB; static final String KETTLE_TRANS_LOG_SCHEMA; static final String KETTLE_TRANS_LOG_TABLE; static final String KETTLE_JOB_LOG_DB; static final String KETTLE_JOB_LOG_SCHEMA; static final String KETTLE_SLAVE_DETECTION_TIMER; static final String KETTLE_JOB_LOG_TABLE; static final String KETTLE_TRANS_PERFORMANCE_LOG_DB; static final String KETTLE_TRANS_PERFORMANCE_LOG_SCHEMA; static final String KETTLE_TRANS_PERFORMANCE_LOG_TABLE; static final String KETTLE_JOBENTRY_LOG_DB; static final String KETTLE_JOBENTRY_LOG_SCHEMA; static final String KETTLE_JOBENTRY_LOG_TABLE; static final String KETTLE_STEP_LOG_DB; static final String KETTLE_STEP_LOG_SCHEMA; static final String KETTLE_STEP_LOG_TABLE; static final String KETTLE_CHANNEL_LOG_DB; static final String KETTLE_CHANNEL_LOG_SCHEMA; static final String KETTLE_CHANNEL_LOG_TABLE; static final String KETTLE_METRICS_LOG_DB; static final String KETTLE_METRICS_LOG_SCHEMA; static final String KETTLE_METRICS_LOG_TABLE; static final String KETTLE_CHECKPOINT_LOG_DB; static final String KETTLE_CHECKPOINT_LOG_SCHEMA; static final String KETTLE_CHECKPOINT_LOG_TABLE; static final String KETTLE_SHARED_OBJECTS; static final String KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL; static final String KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION; static final String KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE; static final String KETTLE_COMPATIBILITY_IMPORT_PATH_ADDITION_ON_VARIABLES; static final String KETTLE_COMPATIBILITY_IGNORE_TABLE_LOGGING; static final String KETTLE_COMPATIBILITY_TEXT_FILE_OUTPUT_APPEND_NO_HEADER; static final String KETTLE_COMPATIBILITY_MERGE_ROWS_USE_REFERENCE_STREAM_WHEN_IDENTICAL; static final String KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE; static final String KETTLE_SYSTEM_HOSTNAME; static final String KETTLE_MAX_LOG_SIZE_IN_LINES; static final String KETTLE_MAX_LOG_TIMEOUT_IN_MINUTES; static final String KETTLE_REDIRECT_STDERR; static final String KETTLE_REDIRECT_STDOUT; static final String KETTLE_CARTE_OBJECT_TIMEOUT_MINUTES; static final String KETTLE_STEP_PERFORMANCE_SNAPSHOT_LIMIT; static final String KETTLE_MAX_JOB_TRACKER_SIZE; static final String KETTLE_MAX_JOB_ENTRIES_LOGGED; static final String KETTLE_MAX_LOGGING_REGISTRY_SIZE; static final String KETTLE_LOG_TAB_REFRESH_DELAY; static final String KETTLE_LOG_TAB_REFRESH_PERIOD; static final String KETTLE_SAP_CONNECTION_FACTORY; static final String KETTLE_SAP_CONNECTION_FACTORY_DEFAULT_NAME; static final String KETTLE_PLUGIN_CLASSES; static final String KETTLE_PLUGIN_PACKAGES; static final String KETTLE_TRANS_ROWSET_SIZE; static final String VERSION_COMMENT_INITIAL_VERSION; static final String VERSION_COMMENT_EDIT_VERSION; static final String XML_FILE_KETTLE_STEPS; static final String KETTLE_CORE_STEPS_FILE; static final String XML_FILE_KETTLE_PARTITION_PLUGINS; static final String KETTLE_CORE_JOBENTRIES_FILE; static final String XML_FILE_KETTLE_SERVLETS; static final String XML_FILE_KETTLE_VALUEMETA_PLUGINS; static final String XML_FILE_KETTLE_PASSWORD_ENCODER_PLUGINS; static final String KETTLE_VALUEMETA_PLUGINS_FILE; static final String KETTLE_PASSWORD_ENCODER_PLUGIN; static final String KETTLE_PASSWORD_ENCODER_PLUGINS_FILE; static final String KETTLE_TWO_WAY_PASSWORD_ENCODER_SEED; static final String XML_FILE_KETTLE_LOGGING_PLUGINS; static final String KETTLE_LOGGING_PLUGINS_FILE; static final String KETTLE_CORE_SERVLETS_FILE; static final String KETTLE_ROWSET_GET_TIMEOUT; static final String KETTLE_ROWSET_PUT_TIMEOUT; static final String KETTLE_BATCHING_ROWSET; static final String KETTLE_DISABLE_CONSOLE_LOGGING; static final String XML_FILE_KETTLE_JOB_ENTRIES; static final String XML_FILE_KETTLE_REPOSITORIES; static final String XML_FILE_KETTLE_DATABASE_TYPES; static final String XML_FILE_KETTLE_COMPRESSION_PROVIDERS; static final String XML_FILE_KETTLE_AUTHENTICATION_PROVIDERS; static final String XML_FILE_KETTLE_EXTENSION_POINTS; static final String XML_FILE_KETTLE_REGISTRY_EXTENSIONS; static final String XML_FILE_KETTLE_LIFECYCLE_LISTENERS; static final String XML_FILE_KETTLE_ENGINES; static final String KETTLE_TRANS_PAN_JVM_EXIT_CODE; static final String KETTLE_DEFAULT_NUMBER_FORMAT; static final String KETTLE_DEFAULT_BIGNUMBER_FORMAT; static final String KETTLE_DEFAULT_INTEGER_FORMAT; static final String KETTLE_DEFAULT_DATE_FORMAT; static final String KETTLE_AGGREGATION_MIN_NULL_IS_VALUED; static final String KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO; static final String KETTLE_DEFAULT_TIMESTAMP_FORMAT; static final String KETTLE_SPLIT_FIELDS_REMOVE_ENCLOSURE; static final String KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT; static final String KETTLE_COMPATIBILITY_CALCULATION_TIMEZONE_DECOMPOSITION; static final String KETTLE_COMPATIBILITY_SET_ERROR_ON_SPECIFIC_JOB_ENTRIES; static final String KETTLE_COMPATIBILITY_SEND_RESULT_XML_WITH_FULL_STATUS; static final String KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS; static final String XML_FILE_KETTLE_IMPORT_RULES; static final ReleaseType RELEASE; static final String PENTAHO_METASTORE_FOLDER; static final String PENTAHO_METASTORE_NAME; static final String KETTLE_LOG_MARK_MAPPINGS; static final String KETTLE_CARTE_JETTY_ACCEPTORS; static final String KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE; static final String KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME; static final String VFS_USER_DIR_IS_ROOT; }
@Test public void test1() throws Exception { String inXml, expectedXml; try ( InputStream in = XMLFormatterTest.class.getResourceAsStream( "XMLFormatterIn1.xml" ) ) { inXml = IOUtils.toString( in ); } try ( InputStream in = XMLFormatterTest.class.getResourceAsStream( "XMLFormatterExpected1.xml" ) ) { expectedXml = IOUtils.toString( in ); } String result = XMLFormatter.format( inXml ); assertEquals( expectedXml, result ); }
public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; StringBuilder str = new StringBuilder(); StringBuilder prefix = new StringBuilder(); boolean wasStart = false; boolean wasSomething = false; while ( rd.hasNext() ) { int event = rd.next(); if ( startElementBuffer != null ) { if ( event == XMLStreamConstants.END_ELEMENT ) { startElementBuffer.writeTo( wr, true ); startElementBuffer = null; prefix.setLength( prefix.length() - STEP_PREFIX.length() ); wasStart = false; continue; } else { startElementBuffer.writeTo( wr, false ); startElementBuffer = null; } } switch ( event ) { case XMLStreamConstants.START_ELEMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); prefix.append( STEP_PREFIX ); startElementBuffer = new StartElementBuffer( rd ); wasStart = true; wasSomething = true; break; case XMLStreamConstants.END_ELEMENT: prefix.setLength( prefix.length() - STEP_PREFIX.length() ); if ( wasStart ) { wr.writeCharacters( str.toString() ); } else { if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else { wr.writeCharacters( "\n" + prefix ); } } str.setLength( 0 ); wr.writeEndElement(); wasStart = false; break; case XMLStreamConstants.SPACE: case XMLStreamConstants.CHARACTERS: str.append( rd.getText() ); break; case XMLStreamConstants.CDATA: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } str.setLength( 0 ); wr.writeCData( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.COMMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); wr.writeComment( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.END_DOCUMENT: wr.writeCharacters( "\n" ); wr.writeEndDocument(); break; default: throw new RuntimeException( "Unknown XML event: " + event ); } } wr.flush(); return result.toString(); } catch ( XMLStreamException ex ) { throw new RuntimeException( ex ); } finally { try { if ( wr != null ) { wr.close(); } } catch ( Exception ex ) { } try { if ( rd != null ) { rd.close(); } } catch ( Exception ex ) { } } }
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; StringBuilder str = new StringBuilder(); StringBuilder prefix = new StringBuilder(); boolean wasStart = false; boolean wasSomething = false; while ( rd.hasNext() ) { int event = rd.next(); if ( startElementBuffer != null ) { if ( event == XMLStreamConstants.END_ELEMENT ) { startElementBuffer.writeTo( wr, true ); startElementBuffer = null; prefix.setLength( prefix.length() - STEP_PREFIX.length() ); wasStart = false; continue; } else { startElementBuffer.writeTo( wr, false ); startElementBuffer = null; } } switch ( event ) { case XMLStreamConstants.START_ELEMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); prefix.append( STEP_PREFIX ); startElementBuffer = new StartElementBuffer( rd ); wasStart = true; wasSomething = true; break; case XMLStreamConstants.END_ELEMENT: prefix.setLength( prefix.length() - STEP_PREFIX.length() ); if ( wasStart ) { wr.writeCharacters( str.toString() ); } else { if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else { wr.writeCharacters( "\n" + prefix ); } } str.setLength( 0 ); wr.writeEndElement(); wasStart = false; break; case XMLStreamConstants.SPACE: case XMLStreamConstants.CHARACTERS: str.append( rd.getText() ); break; case XMLStreamConstants.CDATA: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } str.setLength( 0 ); wr.writeCData( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.COMMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); wr.writeComment( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.END_DOCUMENT: wr.writeCharacters( "\n" ); wr.writeEndDocument(); break; default: throw new RuntimeException( "Unknown XML event: " + event ); } } wr.flush(); return result.toString(); } catch ( XMLStreamException ex ) { throw new RuntimeException( ex ); } finally { try { if ( wr != null ) { wr.close(); } } catch ( Exception ex ) { } try { if ( rd != null ) { rd.close(); } } catch ( Exception ex ) { } } } }
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; StringBuilder str = new StringBuilder(); StringBuilder prefix = new StringBuilder(); boolean wasStart = false; boolean wasSomething = false; while ( rd.hasNext() ) { int event = rd.next(); if ( startElementBuffer != null ) { if ( event == XMLStreamConstants.END_ELEMENT ) { startElementBuffer.writeTo( wr, true ); startElementBuffer = null; prefix.setLength( prefix.length() - STEP_PREFIX.length() ); wasStart = false; continue; } else { startElementBuffer.writeTo( wr, false ); startElementBuffer = null; } } switch ( event ) { case XMLStreamConstants.START_ELEMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); prefix.append( STEP_PREFIX ); startElementBuffer = new StartElementBuffer( rd ); wasStart = true; wasSomething = true; break; case XMLStreamConstants.END_ELEMENT: prefix.setLength( prefix.length() - STEP_PREFIX.length() ); if ( wasStart ) { wr.writeCharacters( str.toString() ); } else { if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else { wr.writeCharacters( "\n" + prefix ); } } str.setLength( 0 ); wr.writeEndElement(); wasStart = false; break; case XMLStreamConstants.SPACE: case XMLStreamConstants.CHARACTERS: str.append( rd.getText() ); break; case XMLStreamConstants.CDATA: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } str.setLength( 0 ); wr.writeCData( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.COMMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); wr.writeComment( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.END_DOCUMENT: wr.writeCharacters( "\n" ); wr.writeEndDocument(); break; default: throw new RuntimeException( "Unknown XML event: " + event ); } } wr.flush(); return result.toString(); } catch ( XMLStreamException ex ) { throw new RuntimeException( ex ); } finally { try { if ( wr != null ) { wr.close(); } } catch ( Exception ex ) { } try { if ( rd != null ) { rd.close(); } } catch ( Exception ex ) { } } } }
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; StringBuilder str = new StringBuilder(); StringBuilder prefix = new StringBuilder(); boolean wasStart = false; boolean wasSomething = false; while ( rd.hasNext() ) { int event = rd.next(); if ( startElementBuffer != null ) { if ( event == XMLStreamConstants.END_ELEMENT ) { startElementBuffer.writeTo( wr, true ); startElementBuffer = null; prefix.setLength( prefix.length() - STEP_PREFIX.length() ); wasStart = false; continue; } else { startElementBuffer.writeTo( wr, false ); startElementBuffer = null; } } switch ( event ) { case XMLStreamConstants.START_ELEMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); prefix.append( STEP_PREFIX ); startElementBuffer = new StartElementBuffer( rd ); wasStart = true; wasSomething = true; break; case XMLStreamConstants.END_ELEMENT: prefix.setLength( prefix.length() - STEP_PREFIX.length() ); if ( wasStart ) { wr.writeCharacters( str.toString() ); } else { if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else { wr.writeCharacters( "\n" + prefix ); } } str.setLength( 0 ); wr.writeEndElement(); wasStart = false; break; case XMLStreamConstants.SPACE: case XMLStreamConstants.CHARACTERS: str.append( rd.getText() ); break; case XMLStreamConstants.CDATA: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } str.setLength( 0 ); wr.writeCData( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.COMMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); wr.writeComment( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.END_DOCUMENT: wr.writeCharacters( "\n" ); wr.writeEndDocument(); break; default: throw new RuntimeException( "Unknown XML event: " + event ); } } wr.flush(); return result.toString(); } catch ( XMLStreamException ex ) { throw new RuntimeException( ex ); } finally { try { if ( wr != null ) { wr.close(); } } catch ( Exception ex ) { } try { if ( rd != null ) { rd.close(); } } catch ( Exception ex ) { } } } static String format( String xml ); }
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; StringBuilder str = new StringBuilder(); StringBuilder prefix = new StringBuilder(); boolean wasStart = false; boolean wasSomething = false; while ( rd.hasNext() ) { int event = rd.next(); if ( startElementBuffer != null ) { if ( event == XMLStreamConstants.END_ELEMENT ) { startElementBuffer.writeTo( wr, true ); startElementBuffer = null; prefix.setLength( prefix.length() - STEP_PREFIX.length() ); wasStart = false; continue; } else { startElementBuffer.writeTo( wr, false ); startElementBuffer = null; } } switch ( event ) { case XMLStreamConstants.START_ELEMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); prefix.append( STEP_PREFIX ); startElementBuffer = new StartElementBuffer( rd ); wasStart = true; wasSomething = true; break; case XMLStreamConstants.END_ELEMENT: prefix.setLength( prefix.length() - STEP_PREFIX.length() ); if ( wasStart ) { wr.writeCharacters( str.toString() ); } else { if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else { wr.writeCharacters( "\n" + prefix ); } } str.setLength( 0 ); wr.writeEndElement(); wasStart = false; break; case XMLStreamConstants.SPACE: case XMLStreamConstants.CHARACTERS: str.append( rd.getText() ); break; case XMLStreamConstants.CDATA: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } str.setLength( 0 ); wr.writeCData( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.COMMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); wr.writeComment( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.END_DOCUMENT: wr.writeCharacters( "\n" ); wr.writeEndDocument(); break; default: throw new RuntimeException( "Unknown XML event: " + event ); } } wr.flush(); return result.toString(); } catch ( XMLStreamException ex ) { throw new RuntimeException( ex ); } finally { try { if ( wr != null ) { wr.close(); } } catch ( Exception ex ) { } try { if ( rd != null ) { rd.close(); } } catch ( Exception ex ) { } } } static String format( String xml ); }
@Test public void testcdata() throws Exception { String input = " <annotations>" + " <annotation>" + " <name>c44cc4ed-9647-44f2-b1d9-0523c01f0c94</name>\n" + " <field>HiddenField</field>\n" + " <type>CREATE_ATTRIBUTE</type>\n" + " <properties>" + " <property>" + " <name>hidden</name>\n" + " <value><![CDATA[true]]></value>" + " </property>" + " </properties> " + " </annotation>" + " <sharedDimension>N</sharedDimension>\n" + " <description/>\n" + "</annotations>"; String result = XMLFormatter.format( input ); String expected = "<annotations>\n" + " <annotation>\n" + " <name>c44cc4ed-9647-44f2-b1d9-0523c01f0c94</name>\n" + " <field>HiddenField</field>\n" + " <type>CREATE_ATTRIBUTE</type>\n" + " <properties>\n" + " <property>\n" + " <name>hidden</name>\n" + " <value><![CDATA[true]]></value>\n" + " </property>\n" + " </properties>\n" + " </annotation>\n" + " <sharedDimension>N</sharedDimension>\n" + " <description/>\n" + "</annotations>\n"; assertEquals( expected, result ); }
public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; StringBuilder str = new StringBuilder(); StringBuilder prefix = new StringBuilder(); boolean wasStart = false; boolean wasSomething = false; while ( rd.hasNext() ) { int event = rd.next(); if ( startElementBuffer != null ) { if ( event == XMLStreamConstants.END_ELEMENT ) { startElementBuffer.writeTo( wr, true ); startElementBuffer = null; prefix.setLength( prefix.length() - STEP_PREFIX.length() ); wasStart = false; continue; } else { startElementBuffer.writeTo( wr, false ); startElementBuffer = null; } } switch ( event ) { case XMLStreamConstants.START_ELEMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); prefix.append( STEP_PREFIX ); startElementBuffer = new StartElementBuffer( rd ); wasStart = true; wasSomething = true; break; case XMLStreamConstants.END_ELEMENT: prefix.setLength( prefix.length() - STEP_PREFIX.length() ); if ( wasStart ) { wr.writeCharacters( str.toString() ); } else { if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else { wr.writeCharacters( "\n" + prefix ); } } str.setLength( 0 ); wr.writeEndElement(); wasStart = false; break; case XMLStreamConstants.SPACE: case XMLStreamConstants.CHARACTERS: str.append( rd.getText() ); break; case XMLStreamConstants.CDATA: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } str.setLength( 0 ); wr.writeCData( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.COMMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); wr.writeComment( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.END_DOCUMENT: wr.writeCharacters( "\n" ); wr.writeEndDocument(); break; default: throw new RuntimeException( "Unknown XML event: " + event ); } } wr.flush(); return result.toString(); } catch ( XMLStreamException ex ) { throw new RuntimeException( ex ); } finally { try { if ( wr != null ) { wr.close(); } } catch ( Exception ex ) { } try { if ( rd != null ) { rd.close(); } } catch ( Exception ex ) { } } }
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; StringBuilder str = new StringBuilder(); StringBuilder prefix = new StringBuilder(); boolean wasStart = false; boolean wasSomething = false; while ( rd.hasNext() ) { int event = rd.next(); if ( startElementBuffer != null ) { if ( event == XMLStreamConstants.END_ELEMENT ) { startElementBuffer.writeTo( wr, true ); startElementBuffer = null; prefix.setLength( prefix.length() - STEP_PREFIX.length() ); wasStart = false; continue; } else { startElementBuffer.writeTo( wr, false ); startElementBuffer = null; } } switch ( event ) { case XMLStreamConstants.START_ELEMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); prefix.append( STEP_PREFIX ); startElementBuffer = new StartElementBuffer( rd ); wasStart = true; wasSomething = true; break; case XMLStreamConstants.END_ELEMENT: prefix.setLength( prefix.length() - STEP_PREFIX.length() ); if ( wasStart ) { wr.writeCharacters( str.toString() ); } else { if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else { wr.writeCharacters( "\n" + prefix ); } } str.setLength( 0 ); wr.writeEndElement(); wasStart = false; break; case XMLStreamConstants.SPACE: case XMLStreamConstants.CHARACTERS: str.append( rd.getText() ); break; case XMLStreamConstants.CDATA: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } str.setLength( 0 ); wr.writeCData( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.COMMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); wr.writeComment( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.END_DOCUMENT: wr.writeCharacters( "\n" ); wr.writeEndDocument(); break; default: throw new RuntimeException( "Unknown XML event: " + event ); } } wr.flush(); return result.toString(); } catch ( XMLStreamException ex ) { throw new RuntimeException( ex ); } finally { try { if ( wr != null ) { wr.close(); } } catch ( Exception ex ) { } try { if ( rd != null ) { rd.close(); } } catch ( Exception ex ) { } } } }
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; StringBuilder str = new StringBuilder(); StringBuilder prefix = new StringBuilder(); boolean wasStart = false; boolean wasSomething = false; while ( rd.hasNext() ) { int event = rd.next(); if ( startElementBuffer != null ) { if ( event == XMLStreamConstants.END_ELEMENT ) { startElementBuffer.writeTo( wr, true ); startElementBuffer = null; prefix.setLength( prefix.length() - STEP_PREFIX.length() ); wasStart = false; continue; } else { startElementBuffer.writeTo( wr, false ); startElementBuffer = null; } } switch ( event ) { case XMLStreamConstants.START_ELEMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); prefix.append( STEP_PREFIX ); startElementBuffer = new StartElementBuffer( rd ); wasStart = true; wasSomething = true; break; case XMLStreamConstants.END_ELEMENT: prefix.setLength( prefix.length() - STEP_PREFIX.length() ); if ( wasStart ) { wr.writeCharacters( str.toString() ); } else { if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else { wr.writeCharacters( "\n" + prefix ); } } str.setLength( 0 ); wr.writeEndElement(); wasStart = false; break; case XMLStreamConstants.SPACE: case XMLStreamConstants.CHARACTERS: str.append( rd.getText() ); break; case XMLStreamConstants.CDATA: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } str.setLength( 0 ); wr.writeCData( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.COMMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); wr.writeComment( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.END_DOCUMENT: wr.writeCharacters( "\n" ); wr.writeEndDocument(); break; default: throw new RuntimeException( "Unknown XML event: " + event ); } } wr.flush(); return result.toString(); } catch ( XMLStreamException ex ) { throw new RuntimeException( ex ); } finally { try { if ( wr != null ) { wr.close(); } } catch ( Exception ex ) { } try { if ( rd != null ) { rd.close(); } } catch ( Exception ex ) { } } } }
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; StringBuilder str = new StringBuilder(); StringBuilder prefix = new StringBuilder(); boolean wasStart = false; boolean wasSomething = false; while ( rd.hasNext() ) { int event = rd.next(); if ( startElementBuffer != null ) { if ( event == XMLStreamConstants.END_ELEMENT ) { startElementBuffer.writeTo( wr, true ); startElementBuffer = null; prefix.setLength( prefix.length() - STEP_PREFIX.length() ); wasStart = false; continue; } else { startElementBuffer.writeTo( wr, false ); startElementBuffer = null; } } switch ( event ) { case XMLStreamConstants.START_ELEMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); prefix.append( STEP_PREFIX ); startElementBuffer = new StartElementBuffer( rd ); wasStart = true; wasSomething = true; break; case XMLStreamConstants.END_ELEMENT: prefix.setLength( prefix.length() - STEP_PREFIX.length() ); if ( wasStart ) { wr.writeCharacters( str.toString() ); } else { if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else { wr.writeCharacters( "\n" + prefix ); } } str.setLength( 0 ); wr.writeEndElement(); wasStart = false; break; case XMLStreamConstants.SPACE: case XMLStreamConstants.CHARACTERS: str.append( rd.getText() ); break; case XMLStreamConstants.CDATA: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } str.setLength( 0 ); wr.writeCData( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.COMMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); wr.writeComment( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.END_DOCUMENT: wr.writeCharacters( "\n" ); wr.writeEndDocument(); break; default: throw new RuntimeException( "Unknown XML event: " + event ); } } wr.flush(); return result.toString(); } catch ( XMLStreamException ex ) { throw new RuntimeException( ex ); } finally { try { if ( wr != null ) { wr.close(); } } catch ( Exception ex ) { } try { if ( rd != null ) { rd.close(); } } catch ( Exception ex ) { } } } static String format( String xml ); }
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; StringBuilder str = new StringBuilder(); StringBuilder prefix = new StringBuilder(); boolean wasStart = false; boolean wasSomething = false; while ( rd.hasNext() ) { int event = rd.next(); if ( startElementBuffer != null ) { if ( event == XMLStreamConstants.END_ELEMENT ) { startElementBuffer.writeTo( wr, true ); startElementBuffer = null; prefix.setLength( prefix.length() - STEP_PREFIX.length() ); wasStart = false; continue; } else { startElementBuffer.writeTo( wr, false ); startElementBuffer = null; } } switch ( event ) { case XMLStreamConstants.START_ELEMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); prefix.append( STEP_PREFIX ); startElementBuffer = new StartElementBuffer( rd ); wasStart = true; wasSomething = true; break; case XMLStreamConstants.END_ELEMENT: prefix.setLength( prefix.length() - STEP_PREFIX.length() ); if ( wasStart ) { wr.writeCharacters( str.toString() ); } else { if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else { wr.writeCharacters( "\n" + prefix ); } } str.setLength( 0 ); wr.writeEndElement(); wasStart = false; break; case XMLStreamConstants.SPACE: case XMLStreamConstants.CHARACTERS: str.append( rd.getText() ); break; case XMLStreamConstants.CDATA: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } str.setLength( 0 ); wr.writeCData( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.COMMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); wr.writeComment( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.END_DOCUMENT: wr.writeCharacters( "\n" ); wr.writeEndDocument(); break; default: throw new RuntimeException( "Unknown XML event: " + event ); } } wr.flush(); return result.toString(); } catch ( XMLStreamException ex ) { throw new RuntimeException( ex ); } finally { try { if ( wr != null ) { wr.close(); } } catch ( Exception ex ) { } try { if ( rd != null ) { rd.close(); } } catch ( Exception ex ) { } } } static String format( String xml ); }
@Test public void test2() throws Exception { String inXml, expectedXml; try ( InputStream in = XMLFormatterTest.class.getResourceAsStream( "XMLFormatterIn2.xml" ) ) { inXml = IOUtils.toString( in ); } try ( InputStream in = XMLFormatterTest.class.getResourceAsStream( "XMLFormatterExpected2.xml" ) ) { expectedXml = IOUtils.toString( in ); } String result = XMLFormatter.format( inXml ); assertEquals( expectedXml, result ); }
public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; StringBuilder str = new StringBuilder(); StringBuilder prefix = new StringBuilder(); boolean wasStart = false; boolean wasSomething = false; while ( rd.hasNext() ) { int event = rd.next(); if ( startElementBuffer != null ) { if ( event == XMLStreamConstants.END_ELEMENT ) { startElementBuffer.writeTo( wr, true ); startElementBuffer = null; prefix.setLength( prefix.length() - STEP_PREFIX.length() ); wasStart = false; continue; } else { startElementBuffer.writeTo( wr, false ); startElementBuffer = null; } } switch ( event ) { case XMLStreamConstants.START_ELEMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); prefix.append( STEP_PREFIX ); startElementBuffer = new StartElementBuffer( rd ); wasStart = true; wasSomething = true; break; case XMLStreamConstants.END_ELEMENT: prefix.setLength( prefix.length() - STEP_PREFIX.length() ); if ( wasStart ) { wr.writeCharacters( str.toString() ); } else { if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else { wr.writeCharacters( "\n" + prefix ); } } str.setLength( 0 ); wr.writeEndElement(); wasStart = false; break; case XMLStreamConstants.SPACE: case XMLStreamConstants.CHARACTERS: str.append( rd.getText() ); break; case XMLStreamConstants.CDATA: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } str.setLength( 0 ); wr.writeCData( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.COMMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); wr.writeComment( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.END_DOCUMENT: wr.writeCharacters( "\n" ); wr.writeEndDocument(); break; default: throw new RuntimeException( "Unknown XML event: " + event ); } } wr.flush(); return result.toString(); } catch ( XMLStreamException ex ) { throw new RuntimeException( ex ); } finally { try { if ( wr != null ) { wr.close(); } } catch ( Exception ex ) { } try { if ( rd != null ) { rd.close(); } } catch ( Exception ex ) { } } }
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; StringBuilder str = new StringBuilder(); StringBuilder prefix = new StringBuilder(); boolean wasStart = false; boolean wasSomething = false; while ( rd.hasNext() ) { int event = rd.next(); if ( startElementBuffer != null ) { if ( event == XMLStreamConstants.END_ELEMENT ) { startElementBuffer.writeTo( wr, true ); startElementBuffer = null; prefix.setLength( prefix.length() - STEP_PREFIX.length() ); wasStart = false; continue; } else { startElementBuffer.writeTo( wr, false ); startElementBuffer = null; } } switch ( event ) { case XMLStreamConstants.START_ELEMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); prefix.append( STEP_PREFIX ); startElementBuffer = new StartElementBuffer( rd ); wasStart = true; wasSomething = true; break; case XMLStreamConstants.END_ELEMENT: prefix.setLength( prefix.length() - STEP_PREFIX.length() ); if ( wasStart ) { wr.writeCharacters( str.toString() ); } else { if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else { wr.writeCharacters( "\n" + prefix ); } } str.setLength( 0 ); wr.writeEndElement(); wasStart = false; break; case XMLStreamConstants.SPACE: case XMLStreamConstants.CHARACTERS: str.append( rd.getText() ); break; case XMLStreamConstants.CDATA: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } str.setLength( 0 ); wr.writeCData( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.COMMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); wr.writeComment( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.END_DOCUMENT: wr.writeCharacters( "\n" ); wr.writeEndDocument(); break; default: throw new RuntimeException( "Unknown XML event: " + event ); } } wr.flush(); return result.toString(); } catch ( XMLStreamException ex ) { throw new RuntimeException( ex ); } finally { try { if ( wr != null ) { wr.close(); } } catch ( Exception ex ) { } try { if ( rd != null ) { rd.close(); } } catch ( Exception ex ) { } } } }
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; StringBuilder str = new StringBuilder(); StringBuilder prefix = new StringBuilder(); boolean wasStart = false; boolean wasSomething = false; while ( rd.hasNext() ) { int event = rd.next(); if ( startElementBuffer != null ) { if ( event == XMLStreamConstants.END_ELEMENT ) { startElementBuffer.writeTo( wr, true ); startElementBuffer = null; prefix.setLength( prefix.length() - STEP_PREFIX.length() ); wasStart = false; continue; } else { startElementBuffer.writeTo( wr, false ); startElementBuffer = null; } } switch ( event ) { case XMLStreamConstants.START_ELEMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); prefix.append( STEP_PREFIX ); startElementBuffer = new StartElementBuffer( rd ); wasStart = true; wasSomething = true; break; case XMLStreamConstants.END_ELEMENT: prefix.setLength( prefix.length() - STEP_PREFIX.length() ); if ( wasStart ) { wr.writeCharacters( str.toString() ); } else { if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else { wr.writeCharacters( "\n" + prefix ); } } str.setLength( 0 ); wr.writeEndElement(); wasStart = false; break; case XMLStreamConstants.SPACE: case XMLStreamConstants.CHARACTERS: str.append( rd.getText() ); break; case XMLStreamConstants.CDATA: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } str.setLength( 0 ); wr.writeCData( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.COMMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); wr.writeComment( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.END_DOCUMENT: wr.writeCharacters( "\n" ); wr.writeEndDocument(); break; default: throw new RuntimeException( "Unknown XML event: " + event ); } } wr.flush(); return result.toString(); } catch ( XMLStreamException ex ) { throw new RuntimeException( ex ); } finally { try { if ( wr != null ) { wr.close(); } } catch ( Exception ex ) { } try { if ( rd != null ) { rd.close(); } } catch ( Exception ex ) { } } } }
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; StringBuilder str = new StringBuilder(); StringBuilder prefix = new StringBuilder(); boolean wasStart = false; boolean wasSomething = false; while ( rd.hasNext() ) { int event = rd.next(); if ( startElementBuffer != null ) { if ( event == XMLStreamConstants.END_ELEMENT ) { startElementBuffer.writeTo( wr, true ); startElementBuffer = null; prefix.setLength( prefix.length() - STEP_PREFIX.length() ); wasStart = false; continue; } else { startElementBuffer.writeTo( wr, false ); startElementBuffer = null; } } switch ( event ) { case XMLStreamConstants.START_ELEMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); prefix.append( STEP_PREFIX ); startElementBuffer = new StartElementBuffer( rd ); wasStart = true; wasSomething = true; break; case XMLStreamConstants.END_ELEMENT: prefix.setLength( prefix.length() - STEP_PREFIX.length() ); if ( wasStart ) { wr.writeCharacters( str.toString() ); } else { if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else { wr.writeCharacters( "\n" + prefix ); } } str.setLength( 0 ); wr.writeEndElement(); wasStart = false; break; case XMLStreamConstants.SPACE: case XMLStreamConstants.CHARACTERS: str.append( rd.getText() ); break; case XMLStreamConstants.CDATA: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } str.setLength( 0 ); wr.writeCData( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.COMMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); wr.writeComment( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.END_DOCUMENT: wr.writeCharacters( "\n" ); wr.writeEndDocument(); break; default: throw new RuntimeException( "Unknown XML event: " + event ); } } wr.flush(); return result.toString(); } catch ( XMLStreamException ex ) { throw new RuntimeException( ex ); } finally { try { if ( wr != null ) { wr.close(); } } catch ( Exception ex ) { } try { if ( rd != null ) { rd.close(); } } catch ( Exception ex ) { } } } static String format( String xml ); }
XMLFormatter { public static String format( String xml ) { XMLStreamReader rd = null; XMLStreamWriter wr = null; StringWriter result = new StringWriter(); try { rd = INPUT_FACTORY.createXMLStreamReader( new StringReader( xml ) ); wr = OUTPUT_FACTORY.createXMLStreamWriter( result ); StartElementBuffer startElementBuffer = null; StringBuilder str = new StringBuilder(); StringBuilder prefix = new StringBuilder(); boolean wasStart = false; boolean wasSomething = false; while ( rd.hasNext() ) { int event = rd.next(); if ( startElementBuffer != null ) { if ( event == XMLStreamConstants.END_ELEMENT ) { startElementBuffer.writeTo( wr, true ); startElementBuffer = null; prefix.setLength( prefix.length() - STEP_PREFIX.length() ); wasStart = false; continue; } else { startElementBuffer.writeTo( wr, false ); startElementBuffer = null; } } switch ( event ) { case XMLStreamConstants.START_ELEMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); prefix.append( STEP_PREFIX ); startElementBuffer = new StartElementBuffer( rd ); wasStart = true; wasSomething = true; break; case XMLStreamConstants.END_ELEMENT: prefix.setLength( prefix.length() - STEP_PREFIX.length() ); if ( wasStart ) { wr.writeCharacters( str.toString() ); } else { if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else { wr.writeCharacters( "\n" + prefix ); } } str.setLength( 0 ); wr.writeEndElement(); wasStart = false; break; case XMLStreamConstants.SPACE: case XMLStreamConstants.CHARACTERS: str.append( rd.getText() ); break; case XMLStreamConstants.CDATA: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } str.setLength( 0 ); wr.writeCData( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.COMMENT: if ( !whitespacesOnly( str ) ) { wr.writeCharacters( str.toString() ); } else if ( wasSomething ) { wr.writeCharacters( "\n" + prefix ); } str.setLength( 0 ); wr.writeComment( rd.getText() ); wasSomething = true; break; case XMLStreamConstants.END_DOCUMENT: wr.writeCharacters( "\n" ); wr.writeEndDocument(); break; default: throw new RuntimeException( "Unknown XML event: " + event ); } } wr.flush(); return result.toString(); } catch ( XMLStreamException ex ) { throw new RuntimeException( ex ); } finally { try { if ( wr != null ) { wr.close(); } } catch ( Exception ex ) { } try { if ( rd != null ) { rd.close(); } } catch ( Exception ex ) { } } } static String format( String xml ); }
@Test( expected = KettleException.class ) public void exceptionIsThrownWhenParsingXmlWithBigAmountOfExternalEntities() throws KettleException { final String maliciousXml = "<?xml version=\"1.0\"?>\n" + "<!DOCTYPE lolz [\n" + " <!ENTITY lol \"lol\">\n" + " <!ELEMENT lolz (#PCDATA)>\n" + " <!ENTITY lol1 \"&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;\">\n" + " <!ENTITY lol2 \"&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;\">\n" + " <!ENTITY lol3 \"&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;\">\n" + " <!ENTITY lol4 \"&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;\">\n" + " <!ENTITY lol5 \"&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;\">\n" + " <!ENTITY lol6 \"&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;\">\n" + " <!ENTITY lol7 \"&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;\">\n" + " <!ENTITY lol8 \"&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;\">\n" + " <!ENTITY lol9 \"&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;\">\n" + "]>\n" + "<lolz>&lol9;</lolz>"; XMLCheck.isXMLWellFormed( new ByteArrayInputStream( maliciousXml.getBytes() ) ); }
public static boolean isXMLWellFormed( InputStream is ) throws KettleException { boolean retval = false; try { SAXParserFactory factory = XMLParserFactoryProducer.createSecureSAXParserFactory(); XMLTreeHandler handler = new XMLTreeHandler(); SAXParser saxParser = factory.newSAXParser(); saxParser.parse( is, handler ); retval = true; } catch ( Exception e ) { throw new KettleException( e ); } return retval; }
XMLCheck { public static boolean isXMLWellFormed( InputStream is ) throws KettleException { boolean retval = false; try { SAXParserFactory factory = XMLParserFactoryProducer.createSecureSAXParserFactory(); XMLTreeHandler handler = new XMLTreeHandler(); SAXParser saxParser = factory.newSAXParser(); saxParser.parse( is, handler ); retval = true; } catch ( Exception e ) { throw new KettleException( e ); } return retval; } }
XMLCheck { public static boolean isXMLWellFormed( InputStream is ) throws KettleException { boolean retval = false; try { SAXParserFactory factory = XMLParserFactoryProducer.createSecureSAXParserFactory(); XMLTreeHandler handler = new XMLTreeHandler(); SAXParser saxParser = factory.newSAXParser(); saxParser.parse( is, handler ); retval = true; } catch ( Exception e ) { throw new KettleException( e ); } return retval; } }
XMLCheck { public static boolean isXMLWellFormed( InputStream is ) throws KettleException { boolean retval = false; try { SAXParserFactory factory = XMLParserFactoryProducer.createSecureSAXParserFactory(); XMLTreeHandler handler = new XMLTreeHandler(); SAXParser saxParser = factory.newSAXParser(); saxParser.parse( is, handler ); retval = true; } catch ( Exception e ) { throw new KettleException( e ); } return retval; } static final boolean isXMLFileWellFormed( FileObject file ); static boolean isXMLWellFormed( InputStream is ); }
XMLCheck { public static boolean isXMLWellFormed( InputStream is ) throws KettleException { boolean retval = false; try { SAXParserFactory factory = XMLParserFactoryProducer.createSecureSAXParserFactory(); XMLTreeHandler handler = new XMLTreeHandler(); SAXParser saxParser = factory.newSAXParser(); saxParser.parse( is, handler ); retval = true; } catch ( Exception e ) { throw new KettleException( e ); } return retval; } static final boolean isXMLFileWellFormed( FileObject file ); static boolean isXMLWellFormed( InputStream is ); }
@Test public void testStartsWithScheme() { String fileName = "zip:file: assertTrue( KettleVFS.startsWithScheme( fileName ) ); fileName = "SavedLinkedres.zip!Calculate median and percentiles using the group by steps.ktr"; assertFalse( KettleVFS.startsWithScheme( fileName ) ); }
public static boolean startsWithScheme( String vfsFileName ) { FileSystemManager fsManager = getInstance().getFileSystemManager(); boolean found = false; String[] schemes = fsManager.getSchemes(); for ( int i = 0; i < schemes.length; i++ ) { if ( vfsFileName.startsWith( schemes[i] + ":" ) ) { found = true; break; } } return found; }
KettleVFS { public static boolean startsWithScheme( String vfsFileName ) { FileSystemManager fsManager = getInstance().getFileSystemManager(); boolean found = false; String[] schemes = fsManager.getSchemes(); for ( int i = 0; i < schemes.length; i++ ) { if ( vfsFileName.startsWith( schemes[i] + ":" ) ) { found = true; break; } } return found; } }
KettleVFS { public static boolean startsWithScheme( String vfsFileName ) { FileSystemManager fsManager = getInstance().getFileSystemManager(); boolean found = false; String[] schemes = fsManager.getSchemes(); for ( int i = 0; i < schemes.length; i++ ) { if ( vfsFileName.startsWith( schemes[i] + ":" ) ) { found = true; break; } } return found; } private KettleVFS(); }
KettleVFS { public static boolean startsWithScheme( String vfsFileName ) { FileSystemManager fsManager = getInstance().getFileSystemManager(); boolean found = false; String[] schemes = fsManager.getSchemes(); for ( int i = 0; i < schemes.length; i++ ) { if ( vfsFileName.startsWith( schemes[i] + ":" ) ) { found = true; break; } } return found; } private KettleVFS(); FileSystemManager getFileSystemManager(); static KettleVFS getInstance(); static FileObject getFileObject( String vfsFilename ); static FileObject getFileObject( String vfsFilename, VariableSpace space ); static FileObject getFileObject( String vfsFilename, FileSystemOptions fsOptions ); static FileObject getFileObject( String vfsFilename, VariableSpace space, FileSystemOptions fsOptions ); static String getTextFileContent( String vfsFilename, String charSetName ); static String getTextFileContent( String vfsFilename, VariableSpace space, String charSetName ); static boolean fileExists( String vfsFilename ); static boolean fileExists( String vfsFilename, VariableSpace space ); static InputStream getInputStream( FileObject fileObject ); static InputStream getInputStream( String vfsFilename ); static InputStream getInputStream( String vfsFilename, VariableSpace space ); static OutputStream getOutputStream( FileObject fileObject, boolean append ); static OutputStream getOutputStream( String vfsFilename, boolean append ); static OutputStream getOutputStream( String vfsFilename, VariableSpace space, boolean append ); static OutputStream getOutputStream( String vfsFilename, VariableSpace space, FileSystemOptions fsOptions, boolean append ); static String getFilename( FileObject fileObject ); static String getFriendlyURI( String filename ); static String getFriendlyURI( FileObject fileObject ); static FileObject createTempFile( String prefix, String suffix, String directory ); static FileObject createTempFile( String prefix, String suffix, String directory, VariableSpace space ); static Comparator<FileObject> getComparator(); @Deprecated static FileInputStream getFileInputStream( FileObject fileObject ); static boolean startsWithScheme( String vfsFileName ); static void closeEmbeddedFileSystem( String embeddedMetastoreKey ); }
KettleVFS { public static boolean startsWithScheme( String vfsFileName ) { FileSystemManager fsManager = getInstance().getFileSystemManager(); boolean found = false; String[] schemes = fsManager.getSchemes(); for ( int i = 0; i < schemes.length; i++ ) { if ( vfsFileName.startsWith( schemes[i] + ":" ) ) { found = true; break; } } return found; } private KettleVFS(); FileSystemManager getFileSystemManager(); static KettleVFS getInstance(); static FileObject getFileObject( String vfsFilename ); static FileObject getFileObject( String vfsFilename, VariableSpace space ); static FileObject getFileObject( String vfsFilename, FileSystemOptions fsOptions ); static FileObject getFileObject( String vfsFilename, VariableSpace space, FileSystemOptions fsOptions ); static String getTextFileContent( String vfsFilename, String charSetName ); static String getTextFileContent( String vfsFilename, VariableSpace space, String charSetName ); static boolean fileExists( String vfsFilename ); static boolean fileExists( String vfsFilename, VariableSpace space ); static InputStream getInputStream( FileObject fileObject ); static InputStream getInputStream( String vfsFilename ); static InputStream getInputStream( String vfsFilename, VariableSpace space ); static OutputStream getOutputStream( FileObject fileObject, boolean append ); static OutputStream getOutputStream( String vfsFilename, boolean append ); static OutputStream getOutputStream( String vfsFilename, VariableSpace space, boolean append ); static OutputStream getOutputStream( String vfsFilename, VariableSpace space, FileSystemOptions fsOptions, boolean append ); static String getFilename( FileObject fileObject ); static String getFriendlyURI( String filename ); static String getFriendlyURI( FileObject fileObject ); static FileObject createTempFile( String prefix, String suffix, String directory ); static FileObject createTempFile( String prefix, String suffix, String directory, VariableSpace space ); static Comparator<FileObject> getComparator(); @Deprecated static FileInputStream getFileInputStream( FileObject fileObject ); static boolean startsWithScheme( String vfsFileName ); static void closeEmbeddedFileSystem( String embeddedMetastoreKey ); }
@Test public void testPutRow() throws Exception { rowSet.putRow( new RowMeta(), row ); assertSame( row, rowSet.getRow() ); }
@Override public boolean putRow( RowMetaInterface rowMeta, Object[] rowData ) { this.rowMeta = rowMeta; this.row = rowData; return true; }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public boolean putRow( RowMetaInterface rowMeta, Object[] rowData ) { this.rowMeta = rowMeta; this.row = rowData; return true; } }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public boolean putRow( RowMetaInterface rowMeta, Object[] rowData ) { this.rowMeta = rowMeta; this.row = rowData; return true; } }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public boolean putRow( RowMetaInterface rowMeta, Object[] rowData ) { this.rowMeta = rowMeta; this.row = rowData; return true; } @Override Object[] getRow(); @Override Object[] getRowImmediate(); @Override Object[] getRowWait( long timeout, TimeUnit tu ); @Override boolean putRow( RowMetaInterface rowMeta, Object[] rowData ); @Override boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ); @Override int size(); @Override void clear(); }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public boolean putRow( RowMetaInterface rowMeta, Object[] rowData ) { this.rowMeta = rowMeta; this.row = rowData; return true; } @Override Object[] getRow(); @Override Object[] getRowImmediate(); @Override Object[] getRowWait( long timeout, TimeUnit tu ); @Override boolean putRow( RowMetaInterface rowMeta, Object[] rowData ); @Override boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ); @Override int size(); @Override void clear(); }
@Test public void testPutRowWait() throws Exception { rowSet.putRowWait( new RowMeta(), row, 1, TimeUnit.SECONDS ); assertSame( row, rowSet.getRowWait( 1, TimeUnit.SECONDS ) ); }
@Override public boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ) { return putRow( rowMeta, rowData ); }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ) { return putRow( rowMeta, rowData ); } }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ) { return putRow( rowMeta, rowData ); } }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ) { return putRow( rowMeta, rowData ); } @Override Object[] getRow(); @Override Object[] getRowImmediate(); @Override Object[] getRowWait( long timeout, TimeUnit tu ); @Override boolean putRow( RowMetaInterface rowMeta, Object[] rowData ); @Override boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ); @Override int size(); @Override void clear(); }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ) { return putRow( rowMeta, rowData ); } @Override Object[] getRow(); @Override Object[] getRowImmediate(); @Override Object[] getRowWait( long timeout, TimeUnit tu ); @Override boolean putRow( RowMetaInterface rowMeta, Object[] rowData ); @Override boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ); @Override int size(); @Override void clear(); }
@Test public void testIncludesSubTransformations() throws Exception { TransMeta parentTransMeta = new TransMeta( getClass().getResource( "trans-meta-converter-parent.ktr" ).getPath() ); Transformation transformation = TransMetaConverter.convert( parentTransMeta ); @SuppressWarnings( { "unchecked", "ConstantConditions" } ) HashMap<String, Transformation> config = (HashMap<String, Transformation>) transformation.getConfig( TransMetaConverter.SUB_TRANSFORMATIONS_KEY ).get(); assertEquals( 1, config.size() ); assertNotNull( "file: }
public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); static final String TRANS_META_CONF_KEY; static final String TRANS_META_NAME_CONF_KEY; static final String SUB_TRANSFORMATIONS_KEY; static final String STEP_META_CONF_KEY; static final String TRANS_DEFAULT_NAME; }
@Test public void testGetRowImmediate() throws Exception { rowSet.putRow( new RowMeta(), row ); assertSame( row, rowSet.getRowImmediate() ); }
@Override public Object[] getRowImmediate() { return getRow(); }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public Object[] getRowImmediate() { return getRow(); } }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public Object[] getRowImmediate() { return getRow(); } }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public Object[] getRowImmediate() { return getRow(); } @Override Object[] getRow(); @Override Object[] getRowImmediate(); @Override Object[] getRowWait( long timeout, TimeUnit tu ); @Override boolean putRow( RowMetaInterface rowMeta, Object[] rowData ); @Override boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ); @Override int size(); @Override void clear(); }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public Object[] getRowImmediate() { return getRow(); } @Override Object[] getRow(); @Override Object[] getRowImmediate(); @Override Object[] getRowWait( long timeout, TimeUnit tu ); @Override boolean putRow( RowMetaInterface rowMeta, Object[] rowData ); @Override boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ); @Override int size(); @Override void clear(); }
@Test public void testSize() throws Exception { assertEquals( 0, rowSet.size() ); rowSet.putRow( new RowMeta(), row ); assertEquals( 1, rowSet.size() ); rowSet.clear(); assertEquals( 0, rowSet.size() ); }
@Override public int size() { return row == null ? 0 : 1; }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public int size() { return row == null ? 0 : 1; } }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public int size() { return row == null ? 0 : 1; } }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public int size() { return row == null ? 0 : 1; } @Override Object[] getRow(); @Override Object[] getRowImmediate(); @Override Object[] getRowWait( long timeout, TimeUnit tu ); @Override boolean putRow( RowMetaInterface rowMeta, Object[] rowData ); @Override boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ); @Override int size(); @Override void clear(); }
SingleRowRowSet extends BaseRowSet implements Comparable<RowSet>, RowSet { @Override public int size() { return row == null ? 0 : 1; } @Override Object[] getRow(); @Override Object[] getRowImmediate(); @Override Object[] getRowWait( long timeout, TimeUnit tu ); @Override boolean putRow( RowMetaInterface rowMeta, Object[] rowData ); @Override boolean putRowWait( RowMetaInterface rowMeta, Object[] rowData, long time, TimeUnit tu ); @Override int size(); @Override void clear(); }
@Test public void testGetRegexpByDateFormat() { assertNull( DateDetector.getRegexpByDateFormat( null ) ); assertEquals( SAMPLE_REGEXP, DateDetector.getRegexpByDateFormat( SAMPLE_DATE_FORMAT ) ); }
public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); }
DateDetector { public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); } }
DateDetector { public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); } private DateDetector(); }
DateDetector { public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
DateDetector { public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
@Test public void testGetRegexpByDateFormatLocale() { assertNull( DateDetector.getRegexpByDateFormat( null, null ) ); assertNull( DateDetector.getRegexpByDateFormat( null, LOCALE_en_US ) ); assertNull( DateDetector.getRegexpByDateFormat( SAMPLE_DATE_FORMAT_US ) ); assertEquals( SAMPLE_REGEXP_US, DateDetector.getRegexpByDateFormat( SAMPLE_DATE_FORMAT_US, LOCALE_en_US ) ); }
public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); }
DateDetector { public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); } }
DateDetector { public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); } private DateDetector(); }
DateDetector { public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
DateDetector { public static String getRegexpByDateFormat( String dateFormat ) { return getRegexpByDateFormat( dateFormat, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
@Test public void testGetDateFormatByRegex() { assertNull( DateDetector.getDateFormatByRegex( null ) ); assertEquals( SAMPLE_DATE_FORMAT, DateDetector.getDateFormatByRegex( SAMPLE_REGEXP ) ); }
public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); }
DateDetector { public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); } }
DateDetector { public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); } private DateDetector(); }
DateDetector { public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
DateDetector { public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
@Test public void testGetDateFormatByRegexLocale() { assertNull( DateDetector.getDateFormatByRegex( null, null ) ); assertNull( DateDetector.getDateFormatByRegex( null, LOCALE_en_US ) ); assertEquals( SAMPLE_DATE_FORMAT, DateDetector.getDateFormatByRegex( SAMPLE_REGEXP_US ) ); assertEquals( SAMPLE_DATE_FORMAT_US, DateDetector.getDateFormatByRegex( SAMPLE_REGEXP_US, LOCALE_en_US ) ); }
public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); }
DateDetector { public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); } }
DateDetector { public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); } private DateDetector(); }
DateDetector { public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
DateDetector { public static String getDateFormatByRegex( String regex ) { return getDateFormatByRegex( regex, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
@Test public void testGetDateFromString() throws ParseException { assertEquals( SAMPLE_DATE_US, DateDetector.getDateFromString( SAMPLE_DATE_STRING_US ) ); try { DateDetector.getDateFromString( null ); } catch ( ParseException e ) { } }
public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); }
DateDetector { public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); } }
DateDetector { public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); } private DateDetector(); }
DateDetector { public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
DateDetector { public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
@Test public void testGetDateFromStringLocale() throws ParseException { assertEquals( SAMPLE_DATE_US, DateDetector.getDateFromString( SAMPLE_DATE_STRING_US, LOCALE_en_US ) ); try { DateDetector.getDateFromString( null ); } catch ( ParseException e ) { } try { DateDetector.getDateFromString( null, null ); } catch ( ParseException e ) { } }
public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); }
DateDetector { public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); } }
DateDetector { public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); } private DateDetector(); }
DateDetector { public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
DateDetector { public static Date getDateFromString( String dateString ) throws ParseException { String dateFormat = detectDateFormat( dateString ); if ( dateFormat == null ) { throw new ParseException( "Unknown date format.", 0 ); } return getDateFromStringByFormat( dateString, dateFormat ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
@Test public void testGetDateFromStringByFormat() throws ParseException { assertEquals( SAMPLE_DATE, DateDetector.getDateFromStringByFormat( SAMPLE_DATE_STRING, SAMPLE_DATE_FORMAT ) ); try { DateDetector.getDateFromStringByFormat( SAMPLE_DATE_STRING, null ); } catch ( ParseException e ) { } try { DateDetector.getDateFromStringByFormat( null, SAMPLE_DATE_FORMAT ); } catch ( ParseException e ) { } }
public static Date getDateFromStringByFormat( String dateString, String dateFormat ) throws ParseException { if ( dateFormat == null ) { throw new ParseException( "Unknown date format. Format is null. ", 0 ); } if ( dateString == null ) { throw new ParseException( "Unknown date string. Date string is null. ", 0 ); } SimpleDateFormat simpleDateFormat = new SimpleDateFormat( dateFormat ); simpleDateFormat.setLenient( false ); return simpleDateFormat.parse( dateString ); }
DateDetector { public static Date getDateFromStringByFormat( String dateString, String dateFormat ) throws ParseException { if ( dateFormat == null ) { throw new ParseException( "Unknown date format. Format is null. ", 0 ); } if ( dateString == null ) { throw new ParseException( "Unknown date string. Date string is null. ", 0 ); } SimpleDateFormat simpleDateFormat = new SimpleDateFormat( dateFormat ); simpleDateFormat.setLenient( false ); return simpleDateFormat.parse( dateString ); } }
DateDetector { public static Date getDateFromStringByFormat( String dateString, String dateFormat ) throws ParseException { if ( dateFormat == null ) { throw new ParseException( "Unknown date format. Format is null. ", 0 ); } if ( dateString == null ) { throw new ParseException( "Unknown date string. Date string is null. ", 0 ); } SimpleDateFormat simpleDateFormat = new SimpleDateFormat( dateFormat ); simpleDateFormat.setLenient( false ); return simpleDateFormat.parse( dateString ); } private DateDetector(); }
DateDetector { public static Date getDateFromStringByFormat( String dateString, String dateFormat ) throws ParseException { if ( dateFormat == null ) { throw new ParseException( "Unknown date format. Format is null. ", 0 ); } if ( dateString == null ) { throw new ParseException( "Unknown date string. Date string is null. ", 0 ); } SimpleDateFormat simpleDateFormat = new SimpleDateFormat( dateFormat ); simpleDateFormat.setLenient( false ); return simpleDateFormat.parse( dateString ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
DateDetector { public static Date getDateFromStringByFormat( String dateString, String dateFormat ) throws ParseException { if ( dateFormat == null ) { throw new ParseException( "Unknown date format. Format is null. ", 0 ); } if ( dateString == null ) { throw new ParseException( "Unknown date string. Date string is null. ", 0 ); } SimpleDateFormat simpleDateFormat = new SimpleDateFormat( dateFormat ); simpleDateFormat.setLenient( false ); return simpleDateFormat.parse( dateString ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
@Test public void testDetectDateFormat() { assertEquals( SAMPLE_DATE_FORMAT, DateDetector.detectDateFormat( SAMPLE_DATE_STRING, LOCALE_es ) ); assertNull( DateDetector.detectDateFormat( null ) ); }
public static String detectDateFormat( String dateString ) { return detectDateFormat( dateString, null ); }
DateDetector { public static String detectDateFormat( String dateString ) { return detectDateFormat( dateString, null ); } }
DateDetector { public static String detectDateFormat( String dateString ) { return detectDateFormat( dateString, null ); } private DateDetector(); }
DateDetector { public static String detectDateFormat( String dateString ) { return detectDateFormat( dateString, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
DateDetector { public static String detectDateFormat( String dateString ) { return detectDateFormat( dateString, null ); } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
@Test public void testClonesTransMeta() throws KettleException { class ResultCaptor implements Answer<Object> { private Object result; public Object getResult() { return result; } @Override public java.lang.Object answer( InvocationOnMock invocationOnMock ) throws Throwable { result = invocationOnMock.callRealMethod(); return result; } } TransMeta originalTransMeta = spy( new TransMeta() ); ResultCaptor cloneTransMetaCaptor = new ResultCaptor(); doAnswer( cloneTransMetaCaptor ).when( originalTransMeta ).realClone( eq( false ) ); originalTransMeta.setName( "TransName" ); TransMetaConverter.convert( originalTransMeta ); TransMeta cloneTransMeta = (TransMeta) cloneTransMetaCaptor.getResult(); verify( originalTransMeta ).realClone( eq( false ) ); assertThat( cloneTransMeta.getName(), is( originalTransMeta.getName() ) ); verify( originalTransMeta, never() ).getXML(); verify( cloneTransMeta ).getXML(); }
public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); static final String TRANS_META_CONF_KEY; static final String TRANS_META_NAME_CONF_KEY; static final String SUB_TRANSFORMATIONS_KEY; static final String STEP_META_CONF_KEY; static final String TRANS_DEFAULT_NAME; }
@Test public void testIsValidDate() { assertTrue( DateDetector.isValidDate( SAMPLE_DATE_STRING_US ) ); assertFalse( DateDetector.isValidDate( null ) ); assertTrue( DateDetector.isValidDate( SAMPLE_DATE_STRING, SAMPLE_DATE_FORMAT ) ); assertFalse( DateDetector.isValidDate( SAMPLE_DATE_STRING, null ) ); }
public static boolean isValidDate( String dateString, String dateFormat ) { try { getDateFromStringByFormat( dateString, dateFormat ); return true; } catch ( ParseException e ) { return false; } }
DateDetector { public static boolean isValidDate( String dateString, String dateFormat ) { try { getDateFromStringByFormat( dateString, dateFormat ); return true; } catch ( ParseException e ) { return false; } } }
DateDetector { public static boolean isValidDate( String dateString, String dateFormat ) { try { getDateFromStringByFormat( dateString, dateFormat ); return true; } catch ( ParseException e ) { return false; } } private DateDetector(); }
DateDetector { public static boolean isValidDate( String dateString, String dateFormat ) { try { getDateFromStringByFormat( dateString, dateFormat ); return true; } catch ( ParseException e ) { return false; } } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
DateDetector { public static boolean isValidDate( String dateString, String dateFormat ) { try { getDateFromStringByFormat( dateString, dateFormat ); return true; } catch ( ParseException e ) { return false; } } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
@Test public void testIsValidDateFormatToStringDate() { assertTrue( DateDetector.isValidDateFormatToStringDate( SAMPLE_DATE_FORMAT_US, SAMPLE_DATE_STRING_US ) ); assertFalse( DateDetector.isValidDateFormatToStringDate( null, SAMPLE_DATE_STRING_US ) ); assertFalse( DateDetector.isValidDateFormatToStringDate( SAMPLE_DATE_FORMAT_US, null ) ); }
public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; }
DateDetector { public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; } }
DateDetector { public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; } private DateDetector(); }
DateDetector { public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
DateDetector { public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
@Test public void testIsValidDateFormatToStringDateLocale() { assertTrue( DateDetector.isValidDateFormatToStringDate( SAMPLE_DATE_FORMAT_US, SAMPLE_DATE_STRING_US, LOCALE_en_US ) ); assertFalse( DateDetector.isValidDateFormatToStringDate( null, SAMPLE_DATE_STRING, LOCALE_en_US ) ); assertFalse( DateDetector.isValidDateFormatToStringDate( SAMPLE_DATE_FORMAT_US, null, LOCALE_en_US ) ); assertTrue( DateDetector.isValidDateFormatToStringDate( SAMPLE_DATE_FORMAT_US, SAMPLE_DATE_STRING_US, null ) ); }
public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; }
DateDetector { public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; } }
DateDetector { public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; } private DateDetector(); }
DateDetector { public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
DateDetector { public static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ) { String detectedDateFormat = detectDateFormat( dateString ); if ( ( dateFormat != null ) && ( dateFormat.equals( detectedDateFormat ) ) ) { return true; } return false; } private DateDetector(); static String getRegexpByDateFormat( String dateFormat ); static String getRegexpByDateFormat( String dateFormat, String locale ); static String getDateFormatByRegex( String regex ); static String getDateFormatByRegex( String regex, String locale ); static Date getDateFromString( String dateString ); static Date getDateFromString( String dateString, String locale ); static Date getDateFromStringByFormat( String dateString, String dateFormat ); static String detectDateFormat( String dateString ); static String detectDateFormat( String dateString, String locale ); static String detectDateFormatBiased( String dateString, String locale, String desiredKey ); static BidiMap getDateFormatToRegExps( String locale ); static boolean isValidDate( String dateString, String dateFormat ); static boolean isValidDate( String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString ); static boolean isValidDateFormatToStringDate( String dateFormat, String dateString, String locale ); }
@Test public void testGetCount() { List<String> strings = Arrays.asList( "02/29/2000", "03/29/2000" ); for ( String string : strings ) { evaluator.evaluateString( string ); } assertEquals( strings.size(), evaluator.getCount() ); }
public int getCount() { return count; }
StringEvaluator { public int getCount() { return count; } }
StringEvaluator { public int getCount() { return count; } StringEvaluator(); StringEvaluator( boolean tryTrimming ); StringEvaluator( boolean tryTrimming, List<String> numberFormats, List<String> dateFormats ); StringEvaluator( boolean tryTrimming, String[] numberFormats, String[] dateFormats ); }
StringEvaluator { public int getCount() { return count; } StringEvaluator(); StringEvaluator( boolean tryTrimming ); StringEvaluator( boolean tryTrimming, List<String> numberFormats, List<String> dateFormats ); StringEvaluator( boolean tryTrimming, String[] numberFormats, String[] dateFormats ); void evaluateString( String value ); StringEvaluationResult getAdvicedResult(); String[] getDateFormats(); String[] getNumberFormats(); Set<String> getValues(); List<StringEvaluationResult> getStringEvaluationResults(); int getCount(); int getMaxLength(); }
StringEvaluator { public int getCount() { return count; } StringEvaluator(); StringEvaluator( boolean tryTrimming ); StringEvaluator( boolean tryTrimming, List<String> numberFormats, List<String> dateFormats ); StringEvaluator( boolean tryTrimming, String[] numberFormats, String[] dateFormats ); void evaluateString( String value ); StringEvaluationResult getAdvicedResult(); String[] getDateFormats(); String[] getNumberFormats(); Set<String> getValues(); List<StringEvaluationResult> getStringEvaluationResults(); int getCount(); int getMaxLength(); }
@Test public void vfsUserDirIsRoot_IsPublishedOnInitialisation() throws Exception { EnvUtil.environmentInit(); assertNotNull( Variables.getADefaultVariableSpace().getVariable( Const.VFS_USER_DIR_IS_ROOT ) ); assertNotNull( System.getProperty( Const.VFS_USER_DIR_IS_ROOT ) ); }
public static void environmentInit() throws KettleException { if ( Thread.currentThread().getContextClassLoader() == null ) { Thread.currentThread().setContextClassLoader( ClassLoader.getSystemClassLoader() ); } Map<Object, Object> kettleProperties = EnvUtil.readProperties( Const.KETTLE_PROPERTIES ); insertDefaultValues( kettleProperties ); applyKettleProperties( kettleProperties ); System.getProperties().put( Const.INTERNAL_VARIABLE_CLUSTER_SIZE, "1" ); System.getProperties().put( Const.INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER, "0" ); System.getProperties().put( Const.INTERNAL_VARIABLE_SLAVE_SERVER_NAME, "slave-trans-name" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_COPYNR, "0" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_NAME, "step-name" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_PARTITION_ID, "partition-id" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_PARTITION_NR, "0" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_UNIQUE_COUNT, "1" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER, "0" ); }
EnvUtil { public static void environmentInit() throws KettleException { if ( Thread.currentThread().getContextClassLoader() == null ) { Thread.currentThread().setContextClassLoader( ClassLoader.getSystemClassLoader() ); } Map<Object, Object> kettleProperties = EnvUtil.readProperties( Const.KETTLE_PROPERTIES ); insertDefaultValues( kettleProperties ); applyKettleProperties( kettleProperties ); System.getProperties().put( Const.INTERNAL_VARIABLE_CLUSTER_SIZE, "1" ); System.getProperties().put( Const.INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER, "0" ); System.getProperties().put( Const.INTERNAL_VARIABLE_SLAVE_SERVER_NAME, "slave-trans-name" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_COPYNR, "0" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_NAME, "step-name" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_PARTITION_ID, "partition-id" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_PARTITION_NR, "0" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_UNIQUE_COUNT, "1" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER, "0" ); } }
EnvUtil { public static void environmentInit() throws KettleException { if ( Thread.currentThread().getContextClassLoader() == null ) { Thread.currentThread().setContextClassLoader( ClassLoader.getSystemClassLoader() ); } Map<Object, Object> kettleProperties = EnvUtil.readProperties( Const.KETTLE_PROPERTIES ); insertDefaultValues( kettleProperties ); applyKettleProperties( kettleProperties ); System.getProperties().put( Const.INTERNAL_VARIABLE_CLUSTER_SIZE, "1" ); System.getProperties().put( Const.INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER, "0" ); System.getProperties().put( Const.INTERNAL_VARIABLE_SLAVE_SERVER_NAME, "slave-trans-name" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_COPYNR, "0" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_NAME, "step-name" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_PARTITION_ID, "partition-id" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_PARTITION_NR, "0" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_UNIQUE_COUNT, "1" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER, "0" ); } }
EnvUtil { public static void environmentInit() throws KettleException { if ( Thread.currentThread().getContextClassLoader() == null ) { Thread.currentThread().setContextClassLoader( ClassLoader.getSystemClassLoader() ); } Map<Object, Object> kettleProperties = EnvUtil.readProperties( Const.KETTLE_PROPERTIES ); insertDefaultValues( kettleProperties ); applyKettleProperties( kettleProperties ); System.getProperties().put( Const.INTERNAL_VARIABLE_CLUSTER_SIZE, "1" ); System.getProperties().put( Const.INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER, "0" ); System.getProperties().put( Const.INTERNAL_VARIABLE_SLAVE_SERVER_NAME, "slave-trans-name" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_COPYNR, "0" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_NAME, "step-name" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_PARTITION_ID, "partition-id" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_PARTITION_NR, "0" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_UNIQUE_COUNT, "1" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER, "0" ); } static Properties readProperties( final String fileName ); static void environmentInit(); static void applyKettleProperties( Map<?, ?> kettleProperties ); static void applyKettleProperties( Map<?, ?> kettleProperties, boolean override ); static void addInternalVariables( Properties prop ); static final String[] getEnvironmentVariablesForRuntimeExec(); static final String getSystemPropertyStripQuotes( String key, String def ); static final String getSystemProperty( String key, String def ); static final String getSystemProperty( String key ); static Locale createLocale( String localeCode ); static TimeZone createTimeZone( String timeZoneId ); static String[] getTimeZones(); static String[] getLocaleList(); }
EnvUtil { public static void environmentInit() throws KettleException { if ( Thread.currentThread().getContextClassLoader() == null ) { Thread.currentThread().setContextClassLoader( ClassLoader.getSystemClassLoader() ); } Map<Object, Object> kettleProperties = EnvUtil.readProperties( Const.KETTLE_PROPERTIES ); insertDefaultValues( kettleProperties ); applyKettleProperties( kettleProperties ); System.getProperties().put( Const.INTERNAL_VARIABLE_CLUSTER_SIZE, "1" ); System.getProperties().put( Const.INTERNAL_VARIABLE_SLAVE_SERVER_NUMBER, "0" ); System.getProperties().put( Const.INTERNAL_VARIABLE_SLAVE_SERVER_NAME, "slave-trans-name" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_COPYNR, "0" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_NAME, "step-name" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_PARTITION_ID, "partition-id" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_PARTITION_NR, "0" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_UNIQUE_COUNT, "1" ); System.getProperties().put( Const.INTERNAL_VARIABLE_STEP_UNIQUE_NUMBER, "0" ); } static Properties readProperties( final String fileName ); static void environmentInit(); static void applyKettleProperties( Map<?, ?> kettleProperties ); static void applyKettleProperties( Map<?, ?> kettleProperties, boolean override ); static void addInternalVariables( Properties prop ); static final String[] getEnvironmentVariablesForRuntimeExec(); static final String getSystemPropertyStripQuotes( String key, String def ); static final String getSystemProperty( String key, String def ); static final String getSystemProperty( String key ); static Locale createLocale( String localeCode ); static TimeZone createTimeZone( String timeZoneId ); static String[] getTimeZones(); static String[] getLocaleList(); }
@Test public void createLocale_Null() throws Exception { assertNull( EnvUtil.createLocale( null ) ); }
public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; }
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; } }
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; } }
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; } static Properties readProperties( final String fileName ); static void environmentInit(); static void applyKettleProperties( Map<?, ?> kettleProperties ); static void applyKettleProperties( Map<?, ?> kettleProperties, boolean override ); static void addInternalVariables( Properties prop ); static final String[] getEnvironmentVariablesForRuntimeExec(); static final String getSystemPropertyStripQuotes( String key, String def ); static final String getSystemProperty( String key, String def ); static final String getSystemProperty( String key ); static Locale createLocale( String localeCode ); static TimeZone createTimeZone( String timeZoneId ); static String[] getTimeZones(); static String[] getLocaleList(); }
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; } static Properties readProperties( final String fileName ); static void environmentInit(); static void applyKettleProperties( Map<?, ?> kettleProperties ); static void applyKettleProperties( Map<?, ?> kettleProperties, boolean override ); static void addInternalVariables( Properties prop ); static final String[] getEnvironmentVariablesForRuntimeExec(); static final String getSystemPropertyStripQuotes( String key, String def ); static final String getSystemProperty( String key, String def ); static final String getSystemProperty( String key ); static Locale createLocale( String localeCode ); static TimeZone createTimeZone( String timeZoneId ); static String[] getTimeZones(); static String[] getLocaleList(); }
@Test public void createLocale_Empty() throws Exception { assertNull( EnvUtil.createLocale( "" ) ); }
public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; }
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; } }
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; } }
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; } static Properties readProperties( final String fileName ); static void environmentInit(); static void applyKettleProperties( Map<?, ?> kettleProperties ); static void applyKettleProperties( Map<?, ?> kettleProperties, boolean override ); static void addInternalVariables( Properties prop ); static final String[] getEnvironmentVariablesForRuntimeExec(); static final String getSystemPropertyStripQuotes( String key, String def ); static final String getSystemProperty( String key, String def ); static final String getSystemProperty( String key ); static Locale createLocale( String localeCode ); static TimeZone createTimeZone( String timeZoneId ); static String[] getTimeZones(); static String[] getLocaleList(); }
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; } static Properties readProperties( final String fileName ); static void environmentInit(); static void applyKettleProperties( Map<?, ?> kettleProperties ); static void applyKettleProperties( Map<?, ?> kettleProperties, boolean override ); static void addInternalVariables( Properties prop ); static final String[] getEnvironmentVariablesForRuntimeExec(); static final String getSystemPropertyStripQuotes( String key, String def ); static final String getSystemProperty( String key, String def ); static final String getSystemProperty( String key ); static Locale createLocale( String localeCode ); static TimeZone createTimeZone( String timeZoneId ); static String[] getTimeZones(); static String[] getLocaleList(); }
@Test public void createLocale_SingleCode() throws Exception { assertEquals( Locale.ENGLISH, EnvUtil.createLocale( "en" ) ); }
public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; }
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; } }
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; } }
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; } static Properties readProperties( final String fileName ); static void environmentInit(); static void applyKettleProperties( Map<?, ?> kettleProperties ); static void applyKettleProperties( Map<?, ?> kettleProperties, boolean override ); static void addInternalVariables( Properties prop ); static final String[] getEnvironmentVariablesForRuntimeExec(); static final String getSystemPropertyStripQuotes( String key, String def ); static final String getSystemProperty( String key, String def ); static final String getSystemProperty( String key ); static Locale createLocale( String localeCode ); static TimeZone createTimeZone( String timeZoneId ); static String[] getTimeZones(); static String[] getLocaleList(); }
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; } static Properties readProperties( final String fileName ); static void environmentInit(); static void applyKettleProperties( Map<?, ?> kettleProperties ); static void applyKettleProperties( Map<?, ?> kettleProperties, boolean override ); static void addInternalVariables( Properties prop ); static final String[] getEnvironmentVariablesForRuntimeExec(); static final String getSystemPropertyStripQuotes( String key, String def ); static final String getSystemProperty( String key, String def ); static final String getSystemProperty( String key ); static Locale createLocale( String localeCode ); static TimeZone createTimeZone( String timeZoneId ); static String[] getTimeZones(); static String[] getLocaleList(); }
@Test public void createLocale_DoubleCode() throws Exception { assertEquals( Locale.US, EnvUtil.createLocale( "en_US" ) ); }
public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; }
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; } }
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; } }
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; } static Properties readProperties( final String fileName ); static void environmentInit(); static void applyKettleProperties( Map<?, ?> kettleProperties ); static void applyKettleProperties( Map<?, ?> kettleProperties, boolean override ); static void addInternalVariables( Properties prop ); static final String[] getEnvironmentVariablesForRuntimeExec(); static final String getSystemPropertyStripQuotes( String key, String def ); static final String getSystemProperty( String key, String def ); static final String getSystemProperty( String key ); static Locale createLocale( String localeCode ); static TimeZone createTimeZone( String timeZoneId ); static String[] getTimeZones(); static String[] getLocaleList(); }
EnvUtil { public static Locale createLocale( String localeCode ) { Locale resultLocale = null; if ( !Utils.isEmpty( localeCode ) ) { StringTokenizer parser = new StringTokenizer( localeCode, "_" ); if ( parser.countTokens() == 2 ) { resultLocale = new Locale( parser.nextToken(), parser.nextToken() ); } else { resultLocale = new Locale( localeCode ); } } return resultLocale; } static Properties readProperties( final String fileName ); static void environmentInit(); static void applyKettleProperties( Map<?, ?> kettleProperties ); static void applyKettleProperties( Map<?, ?> kettleProperties, boolean override ); static void addInternalVariables( Properties prop ); static final String[] getEnvironmentVariablesForRuntimeExec(); static final String getSystemPropertyStripQuotes( String key, String def ); static final String getSystemProperty( String key, String def ); static final String getSystemProperty( String key ); static Locale createLocale( String localeCode ); static TimeZone createTimeZone( String timeZoneId ); static String[] getTimeZones(); static String[] getLocaleList(); }
@Test public void testIsEmpty() { assertTrue( Utils.isEmpty( (String) null ) ); assertTrue( Utils.isEmpty( "" ) ); assertFalse( Utils.isEmpty( "test" ) ); }
public static boolean isEmpty( CharSequence val ) { return val == null || val.length() == 0; }
Utils { public static boolean isEmpty( CharSequence val ) { return val == null || val.length() == 0; } }
Utils { public static boolean isEmpty( CharSequence val ) { return val == null || val.length() == 0; } }
Utils { public static boolean isEmpty( CharSequence val ) { return val == null || val.length() == 0; } static int getDamerauLevenshteinDistance( String s, String t ); static boolean isEmpty( CharSequence val ); static boolean isEmpty( CharSequence[] strings ); static boolean isEmpty( Object[] array ); static boolean isEmpty( List<?> list ); static String resolvePassword( VariableSpace variables, String password ); static String[][] normalizeArrays( int normalizeToLength, String[]... arraysToNormalize ); static long[][] normalizeArrays( int normalizeToLength, long[]... arraysToNormalize ); static int[][] normalizeArrays( int normalizeToLength, int[]... arraysToNormalize ); static boolean[][] normalizeArrays( int normalizeToLength, boolean[]... arraysToNormalize ); static short[][] normalizeArrays( int normalizeToLength, short[]... arraysToNormalize ); }
Utils { public static boolean isEmpty( CharSequence val ) { return val == null || val.length() == 0; } static int getDamerauLevenshteinDistance( String s, String t ); static boolean isEmpty( CharSequence val ); static boolean isEmpty( CharSequence[] strings ); static boolean isEmpty( Object[] array ); static boolean isEmpty( List<?> list ); static String resolvePassword( VariableSpace variables, String password ); static String[][] normalizeArrays( int normalizeToLength, String[]... arraysToNormalize ); static long[][] normalizeArrays( int normalizeToLength, long[]... arraysToNormalize ); static int[][] normalizeArrays( int normalizeToLength, int[]... arraysToNormalize ); static boolean[][] normalizeArrays( int normalizeToLength, boolean[]... arraysToNormalize ); static short[][] normalizeArrays( int normalizeToLength, short[]... arraysToNormalize ); }
@Test public void testReplaceHadoopClusterToFileSystemURL() throws KettleException, MetaStoreException { TransMeta origTransMeta = new TransMeta(); Variables variables = new Variables(); String inputUrl = "hc: String outputUrl = "hc: TransMeta transMeta = spy( origTransMeta ); IMetaStore metaStore = mock( IMetaStore.class ); NamedClusterServiceOsgi namedClusterServiceOsgi = mock( NamedClusterServiceOsgi.class ); NamedClusterOsgi namedClusterOsgi = mock( NamedClusterOsgi.class ); NamedClusterEmbedManager namedClusterEmbedManager = mock( NamedClusterEmbedManager.class ); transMeta.setParentVariableSpace( variables ); transMeta.setMetaStore( metaStore ); transMeta.setNamedClusterServiceOsgi( namedClusterServiceOsgi ); doReturn( transMeta ).when( transMeta ).realClone( false ); doReturn( namedClusterEmbedManager ).when( transMeta ).getNamedClusterEmbedManager( ); doReturn( namedClusterOsgi ).when( namedClusterServiceOsgi ).read( "CDH511Unsecure", metaStore ); doReturn( null ).when( namedClusterServiceOsgi ).read( "CDH512Unsecure", metaStore ); when( namedClusterOsgi.processURLsubstitution( inputUrl, metaStore, variables ) ).thenReturn( "hdfs: when( namedClusterOsgi.processURLsubstitution( outputUrl, metaStore, variables ) ).thenReturn( "hdfs: TextFileInputMeta textFileInputMeta = new TextFileInputMeta(); String[] inputFiles = new String[6]; inputFiles[0] = "hc: inputFiles[1] = "hc: inputFiles[2] = "hdfs: inputFiles[3] = "hdfs: inputFiles[4] = "C:/Users/testuser/Downloads/testfile"; inputFiles[5] = "file: textFileInputMeta.setFileNameForTest( inputFiles ); TextFileOutputMeta textFileOutputMeta = new TextFileOutputMeta(); textFileOutputMeta.setFileName( "hc: textFileOutputMeta.allocate( 0 ); StepMeta textFileInput = new StepMeta( "TextFileInput", textFileInputMeta ); StepMeta textFileOutput = new StepMeta( "TextFileOutput", textFileOutputMeta ); transMeta.addStep( textFileInput ); transMeta.addStep( textFileOutput ); transMeta.addTransHop( new TransHopMeta( textFileInput, textFileOutput ) ); TransMeta cloneMeta = getTransMetaFromTrans( TransMetaConverter.convert( transMeta ) ); for ( StepMeta stepMeta : cloneMeta.getSteps() ) { if ( stepMeta.getStepMetaInterface() instanceof TextFileInputMeta ) { TextFileInputMeta meta = (TextFileInputMeta) stepMeta.getStepMetaInterface(); String[] files = meta.getFileName(); for ( int i = 0; i < files.length; i++ ) { if ( files[i] != null ) { assertFalse( files[i].contains( "hc: } } } else if ( stepMeta.getStepMetaInterface() instanceof TextFileOutputMeta ) { TextFileOutputMeta meta = (TextFileOutputMeta) stepMeta.getStepMetaInterface(); String filename = meta.getFileName(); if ( filename != null ) { assertFalse( filename.contains( "hc: } } } }
public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); }
TransMetaConverter { public static Transformation convert( TransMeta transMeta ) { final org.pentaho.di.engine.model.Transformation transformation = new org.pentaho.di.engine.model.Transformation( createTransformationId( transMeta ) ); try { TransMeta copyTransMeta = (TransMeta) transMeta.realClone( false ); cleanupDisabledHops( copyTransMeta ); disableLazyConversion( copyTransMeta ); searchAndReplaceHadoopClusterWithFileSystemURL( copyTransMeta ); copyTransMeta.getSteps().forEach( createOperation( transformation ) ); findHops( copyTransMeta, hop -> true ).forEach( createHop( transformation ) ); transformation.setConfig( TRANS_META_CONF_KEY, copyTransMeta.getXML() ); transformation.setConfig( TRANS_META_NAME_CONF_KEY, Optional.ofNullable( transMeta.getName() ).orElse( TRANS_DEFAULT_NAME ) ); Map<String, Transformation> subTransformations = copyTransMeta.getResourceDependencies().stream() .flatMap( resourceReference -> resourceReference.getEntries().stream() ) .filter( entry -> ResourceEntry.ResourceType.ACTIONFILE.equals( entry.getResourcetype() ) ) .collect( toMap( ResourceEntry::getResource, entry -> { try { return convert( new TransMeta( entry.getResource(), copyTransMeta.getParentVariableSpace() ) ); } catch ( KettleXMLException | KettleMissingPluginsException e ) { throw new RuntimeException( e ); } } ) ); transformation.setConfig( SUB_TRANSFORMATIONS_KEY, (Serializable) subTransformations ); } catch ( KettleException e ) { Throwables.propagate( e ); } return transformation; } static Transformation convert( TransMeta transMeta ); static final String TRANS_META_CONF_KEY; static final String TRANS_META_NAME_CONF_KEY; static final String SUB_TRANSFORMATIONS_KEY; static final String STEP_META_CONF_KEY; static final String TRANS_DEFAULT_NAME; }
@Test( expected = RuntimeException.class ) public void testGetOptionHelpNoDatabase() throws Exception { when( accessBox.getSelectedItem() ).thenReturn( "JNDI" ); when( connectionBox.getSelectedItem() ).thenReturn( "MyDB" ); dataHandler.getOptionHelp(); }
public void getOptionHelp() { String message = null; DatabaseMeta database = new DatabaseMeta(); getInfo( database ); String url = database.getExtraOptionsHelpText(); if ( ( url == null ) || ( url.trim().length() == 0 ) ) { message = Messages.getString( "DataHandler.USER_NO_HELP_AVAILABLE" ); showMessage( message, false ); return; } Status status = Launch.openURL( url ); if ( status.equals( Status.Failed ) ) { message = Messages.getString( "DataHandler.USER_UNABLE_TO_LAUNCH_BROWSER", url ); showMessage( message, false ); } }
DataHandler extends AbstractXulEventHandler { public void getOptionHelp() { String message = null; DatabaseMeta database = new DatabaseMeta(); getInfo( database ); String url = database.getExtraOptionsHelpText(); if ( ( url == null ) || ( url.trim().length() == 0 ) ) { message = Messages.getString( "DataHandler.USER_NO_HELP_AVAILABLE" ); showMessage( message, false ); return; } Status status = Launch.openURL( url ); if ( status.equals( Status.Failed ) ) { message = Messages.getString( "DataHandler.USER_UNABLE_TO_LAUNCH_BROWSER", url ); showMessage( message, false ); } } }
DataHandler extends AbstractXulEventHandler { public void getOptionHelp() { String message = null; DatabaseMeta database = new DatabaseMeta(); getInfo( database ); String url = database.getExtraOptionsHelpText(); if ( ( url == null ) || ( url.trim().length() == 0 ) ) { message = Messages.getString( "DataHandler.USER_NO_HELP_AVAILABLE" ); showMessage( message, false ); return; } Status status = Launch.openURL( url ); if ( status.equals( Status.Failed ) ) { message = Messages.getString( "DataHandler.USER_UNABLE_TO_LAUNCH_BROWSER", url ); showMessage( message, false ); } } DataHandler(); }
DataHandler extends AbstractXulEventHandler { public void getOptionHelp() { String message = null; DatabaseMeta database = new DatabaseMeta(); getInfo( database ); String url = database.getExtraOptionsHelpText(); if ( ( url == null ) || ( url.trim().length() == 0 ) ) { message = Messages.getString( "DataHandler.USER_NO_HELP_AVAILABLE" ); showMessage( message, false ); return; } Status status = Launch.openURL( url ); if ( status.equals( Status.Failed ) ) { message = Messages.getString( "DataHandler.USER_UNABLE_TO_LAUNCH_BROWSER", url ); showMessage( message, false ); } } DataHandler(); void loadConnectionData(); void loadAccessData(); void editOptions( int index ); void clearOptionsData(); void getOptionHelp(); void setDeckChildIndex(); void onPoolingCheck(); void onClusterCheck(); Object getData(); void setData( Object data ); void pushCache(); void popCache(); void onCancel(); void onOK(); void testDatabaseConnection(); void restoreDefaults(); void poolingRowChange( int idx ); void disablePortIfInstancePopulated(); void handleUseSecurityCheckbox(); }
DataHandler extends AbstractXulEventHandler { public void getOptionHelp() { String message = null; DatabaseMeta database = new DatabaseMeta(); getInfo( database ); String url = database.getExtraOptionsHelpText(); if ( ( url == null ) || ( url.trim().length() == 0 ) ) { message = Messages.getString( "DataHandler.USER_NO_HELP_AVAILABLE" ); showMessage( message, false ); return; } Status status = Launch.openURL( url ); if ( status.equals( Status.Failed ) ) { message = Messages.getString( "DataHandler.USER_UNABLE_TO_LAUNCH_BROWSER", url ); showMessage( message, false ); } } DataHandler(); void loadConnectionData(); void loadAccessData(); void editOptions( int index ); void clearOptionsData(); void getOptionHelp(); void setDeckChildIndex(); void onPoolingCheck(); void onClusterCheck(); Object getData(); void setData( Object data ); void pushCache(); void popCache(); void onCancel(); void onOK(); void testDatabaseConnection(); void restoreDefaults(); void poolingRowChange( int idx ); void disablePortIfInstancePopulated(); void handleUseSecurityCheckbox(); static final SortedMap<String, DatabaseInterface> connectionMap; static final Map<String, String> connectionNametoID; }
@Test public void cacheSmallBlock() { SmallBlock smallBlock = new SmallBlock(); BlockHeader header = new BlockHeader(); NulsDigestData hash = NulsDigestData.calcDigestData("abcdefg".getBytes()); header.setHash(hash); manager.cacheSmallBlock(smallBlock); assertTrue(true); this.getSmallBlock(hash, smallBlock); this.removeSmallBlock(hash); manager.cacheSmallBlock(smallBlock); this.clear(); }
public void cacheSmallBlock(SmallBlock smallBlock) { smallBlockCacheMap.put(smallBlock.getHeader().getHash(), smallBlock); }
TemporaryCacheManager { public void cacheSmallBlock(SmallBlock smallBlock) { smallBlockCacheMap.put(smallBlock.getHeader().getHash(), smallBlock); } }
TemporaryCacheManager { public void cacheSmallBlock(SmallBlock smallBlock) { smallBlockCacheMap.put(smallBlock.getHeader().getHash(), smallBlock); } private TemporaryCacheManager(); }
TemporaryCacheManager { public void cacheSmallBlock(SmallBlock smallBlock) { smallBlockCacheMap.put(smallBlock.getHeader().getHash(), smallBlock); } private TemporaryCacheManager(); static TemporaryCacheManager getInstance(); void cacheSmallBlock(SmallBlock smallBlock); void cacheSmallBlockWithRequest(NulsDigestData requestHash, SmallBlock smallBlock); SmallBlock getSmallBlockByRequest(NulsDigestData requestHash); SmallBlock getSmallBlockByHash(NulsDigestData blockHash); boolean cacheTx(Transaction tx); Transaction getTx(NulsDigestData hash); void removeSmallBlock(NulsDigestData hash); void clear(); void destroy(); boolean containsTx(NulsDigestData txHash); int getSmallBlockCount(); int getTxCount(); }
TemporaryCacheManager { public void cacheSmallBlock(SmallBlock smallBlock) { smallBlockCacheMap.put(smallBlock.getHeader().getHash(), smallBlock); } private TemporaryCacheManager(); static TemporaryCacheManager getInstance(); void cacheSmallBlock(SmallBlock smallBlock); void cacheSmallBlockWithRequest(NulsDigestData requestHash, SmallBlock smallBlock); SmallBlock getSmallBlockByRequest(NulsDigestData requestHash); SmallBlock getSmallBlockByHash(NulsDigestData blockHash); boolean cacheTx(Transaction tx); Transaction getTx(NulsDigestData hash); void removeSmallBlock(NulsDigestData hash); void clear(); void destroy(); boolean containsTx(NulsDigestData txHash); int getSmallBlockCount(); int getTxCount(); }
@Test public void testGetRoundByIndex() { assertNotNull(roundManager); assertNotNull(roundManager.getChain()); long index = 1002L; assertEquals(0, roundManager.getRoundList().size()); MeetingRound round = new MeetingRound(); round.setIndex(index); roundManager.addRound(round); assertEquals(1, roundManager.getRoundList().size()); MeetingRound round2 = roundManager.getRoundByIndex(index); assertNotNull(round2); assertEquals(round, round2); }
public MeetingRound getRoundByIndex(long roundIndex) { MeetingRound round = null; for (int i = roundList.size() - 1; i >= 0; i--) { round = roundList.get(i); if (round.getIndex() == roundIndex) { break; } } return round; }
RoundManager { public MeetingRound getRoundByIndex(long roundIndex) { MeetingRound round = null; for (int i = roundList.size() - 1; i >= 0; i--) { round = roundList.get(i); if (round.getIndex() == roundIndex) { break; } } return round; } }
RoundManager { public MeetingRound getRoundByIndex(long roundIndex) { MeetingRound round = null; for (int i = roundList.size() - 1; i >= 0; i--) { round = roundList.get(i); if (round.getIndex() == roundIndex) { break; } } return round; } RoundManager(Chain chain); }
RoundManager { public MeetingRound getRoundByIndex(long roundIndex) { MeetingRound round = null; for (int i = roundList.size() - 1; i >= 0; i--) { round = roundList.get(i); if (round.getIndex() == roundIndex) { break; } } return round; } RoundManager(Chain chain); MeetingRound getRoundByIndex(long roundIndex); void addRound(MeetingRound meetingRound); void checkIsNeedReset(); boolean clearRound(int count); MeetingRound getCurrentRound(); MeetingRound initRound(); MeetingRound resetRound(boolean isRealTime); MeetingRound getNextRound(BlockExtendsData roundData, boolean isRealTime); Chain getChain(); List<MeetingRound> getRoundList(); AccountService getAccountService(); }
RoundManager { public MeetingRound getRoundByIndex(long roundIndex) { MeetingRound round = null; for (int i = roundList.size() - 1; i >= 0; i--) { round = roundList.get(i); if (round.getIndex() == roundIndex) { break; } } return round; } RoundManager(Chain chain); MeetingRound getRoundByIndex(long roundIndex); void addRound(MeetingRound meetingRound); void checkIsNeedReset(); boolean clearRound(int count); MeetingRound getCurrentRound(); MeetingRound initRound(); MeetingRound resetRound(boolean isRealTime); MeetingRound getNextRound(BlockExtendsData roundData, boolean isRealTime); Chain getChain(); List<MeetingRound> getRoundList(); AccountService getAccountService(); }
@Test public void testClearRound() { MeetingRound round = new MeetingRound(); round.setIndex(1l); roundManager.addRound(round); round = new MeetingRound(); round.setIndex(2l); roundManager.addRound(round); round = new MeetingRound(); round.setIndex(3l); roundManager.addRound(round); round = new MeetingRound(); round.setIndex(4l); roundManager.addRound(round); round = new MeetingRound(); round.setIndex(5l); roundManager.addRound(round); round = new MeetingRound(); round.setIndex(6l); roundManager.addRound(round); round = new MeetingRound(); round.setIndex(7l); roundManager.addRound(round); assertEquals(7, roundManager.getRoundList().size()); assertEquals(7L, roundManager.getCurrentRound().getIndex()); boolean success = roundManager.clearRound(3); assert(success); assertEquals(3, roundManager.getRoundList().size()); assertEquals(7L, roundManager.getCurrentRound().getIndex()); }
public boolean clearRound(int count) { Lockers.ROUND_LOCK.lock(); boolean doit = false; try { while (roundList.size() > count) { doit = true; roundList.remove(0); } if (doit) { MeetingRound round = roundList.get(0); round.setPreRound(null); } return true; } finally { Lockers.ROUND_LOCK.unlock(); } }
RoundManager { public boolean clearRound(int count) { Lockers.ROUND_LOCK.lock(); boolean doit = false; try { while (roundList.size() > count) { doit = true; roundList.remove(0); } if (doit) { MeetingRound round = roundList.get(0); round.setPreRound(null); } return true; } finally { Lockers.ROUND_LOCK.unlock(); } } }
RoundManager { public boolean clearRound(int count) { Lockers.ROUND_LOCK.lock(); boolean doit = false; try { while (roundList.size() > count) { doit = true; roundList.remove(0); } if (doit) { MeetingRound round = roundList.get(0); round.setPreRound(null); } return true; } finally { Lockers.ROUND_LOCK.unlock(); } } RoundManager(Chain chain); }
RoundManager { public boolean clearRound(int count) { Lockers.ROUND_LOCK.lock(); boolean doit = false; try { while (roundList.size() > count) { doit = true; roundList.remove(0); } if (doit) { MeetingRound round = roundList.get(0); round.setPreRound(null); } return true; } finally { Lockers.ROUND_LOCK.unlock(); } } RoundManager(Chain chain); MeetingRound getRoundByIndex(long roundIndex); void addRound(MeetingRound meetingRound); void checkIsNeedReset(); boolean clearRound(int count); MeetingRound getCurrentRound(); MeetingRound initRound(); MeetingRound resetRound(boolean isRealTime); MeetingRound getNextRound(BlockExtendsData roundData, boolean isRealTime); Chain getChain(); List<MeetingRound> getRoundList(); AccountService getAccountService(); }
RoundManager { public boolean clearRound(int count) { Lockers.ROUND_LOCK.lock(); boolean doit = false; try { while (roundList.size() > count) { doit = true; roundList.remove(0); } if (doit) { MeetingRound round = roundList.get(0); round.setPreRound(null); } return true; } finally { Lockers.ROUND_LOCK.unlock(); } } RoundManager(Chain chain); MeetingRound getRoundByIndex(long roundIndex); void addRound(MeetingRound meetingRound); void checkIsNeedReset(); boolean clearRound(int count); MeetingRound getCurrentRound(); MeetingRound initRound(); MeetingRound resetRound(boolean isRealTime); MeetingRound getNextRound(BlockExtendsData roundData, boolean isRealTime); Chain getChain(); List<MeetingRound> getRoundList(); AccountService getAccountService(); }
@Test public void testInitRound() { assertNotNull(roundManager); assertNotNull(roundManager.getChain()); Chain chain = roundManager.getChain(); assertNotNull(chain.getEndBlockHeader()); assert(chain.getAllBlockList().size() > 0); MeetingRound round = roundManager.initRound(); assertNotNull(round); assertEquals(round.getIndex(), 2L); Assert.assertEquals(round.getStartTime(), ProtocolConstant.BLOCK_TIME_INTERVAL_MILLIS + 1L); MeetingRound round2 = roundManager.getNextRound(null, false); assertNotNull(round2); assertEquals(round.getIndex(), round2.getIndex()); assertEquals(round.getStartTime(), round2.getStartTime()); round2 = roundManager.getNextRound(null, true); assertNotNull(round2); assert(round.getIndex() < round2.getIndex()); assert(round.getStartTime() < round2.getStartTime()); assertEquals("", 0d, round2.getTotalWeight(), 2200000d); }
public MeetingRound initRound() { MeetingRound currentRound = resetRound(false); if (currentRound.getPreRound() == null) { BlockExtendsData extendsData = null; List<BlockHeader> blockHeaderList = chain.getAllBlockHeaderList(); for (int i = blockHeaderList.size() - 1; i >= 0; i--) { BlockHeader blockHeader = blockHeaderList.get(i); extendsData = new BlockExtendsData(blockHeader.getExtend()); if (extendsData.getRoundIndex() < currentRound.getIndex()) { break; } } MeetingRound preRound = getNextRound(extendsData, false); currentRound.setPreRound(preRound); } return currentRound; }
RoundManager { public MeetingRound initRound() { MeetingRound currentRound = resetRound(false); if (currentRound.getPreRound() == null) { BlockExtendsData extendsData = null; List<BlockHeader> blockHeaderList = chain.getAllBlockHeaderList(); for (int i = blockHeaderList.size() - 1; i >= 0; i--) { BlockHeader blockHeader = blockHeaderList.get(i); extendsData = new BlockExtendsData(blockHeader.getExtend()); if (extendsData.getRoundIndex() < currentRound.getIndex()) { break; } } MeetingRound preRound = getNextRound(extendsData, false); currentRound.setPreRound(preRound); } return currentRound; } }
RoundManager { public MeetingRound initRound() { MeetingRound currentRound = resetRound(false); if (currentRound.getPreRound() == null) { BlockExtendsData extendsData = null; List<BlockHeader> blockHeaderList = chain.getAllBlockHeaderList(); for (int i = blockHeaderList.size() - 1; i >= 0; i--) { BlockHeader blockHeader = blockHeaderList.get(i); extendsData = new BlockExtendsData(blockHeader.getExtend()); if (extendsData.getRoundIndex() < currentRound.getIndex()) { break; } } MeetingRound preRound = getNextRound(extendsData, false); currentRound.setPreRound(preRound); } return currentRound; } RoundManager(Chain chain); }
RoundManager { public MeetingRound initRound() { MeetingRound currentRound = resetRound(false); if (currentRound.getPreRound() == null) { BlockExtendsData extendsData = null; List<BlockHeader> blockHeaderList = chain.getAllBlockHeaderList(); for (int i = blockHeaderList.size() - 1; i >= 0; i--) { BlockHeader blockHeader = blockHeaderList.get(i); extendsData = new BlockExtendsData(blockHeader.getExtend()); if (extendsData.getRoundIndex() < currentRound.getIndex()) { break; } } MeetingRound preRound = getNextRound(extendsData, false); currentRound.setPreRound(preRound); } return currentRound; } RoundManager(Chain chain); MeetingRound getRoundByIndex(long roundIndex); void addRound(MeetingRound meetingRound); void checkIsNeedReset(); boolean clearRound(int count); MeetingRound getCurrentRound(); MeetingRound initRound(); MeetingRound resetRound(boolean isRealTime); MeetingRound getNextRound(BlockExtendsData roundData, boolean isRealTime); Chain getChain(); List<MeetingRound> getRoundList(); AccountService getAccountService(); }
RoundManager { public MeetingRound initRound() { MeetingRound currentRound = resetRound(false); if (currentRound.getPreRound() == null) { BlockExtendsData extendsData = null; List<BlockHeader> blockHeaderList = chain.getAllBlockHeaderList(); for (int i = blockHeaderList.size() - 1; i >= 0; i--) { BlockHeader blockHeader = blockHeaderList.get(i); extendsData = new BlockExtendsData(blockHeader.getExtend()); if (extendsData.getRoundIndex() < currentRound.getIndex()) { break; } } MeetingRound preRound = getNextRound(extendsData, false); currentRound.setPreRound(preRound); } return currentRound; } RoundManager(Chain chain); MeetingRound getRoundByIndex(long roundIndex); void addRound(MeetingRound meetingRound); void checkIsNeedReset(); boolean clearRound(int count); MeetingRound getCurrentRound(); MeetingRound initRound(); MeetingRound resetRound(boolean isRealTime); MeetingRound getNextRound(BlockExtendsData roundData, boolean isRealTime); Chain getChain(); List<MeetingRound> getRoundList(); AccountService getAccountService(); }
@Test public void testGetSmallBlock() { Block block = createBlock(); SmallBlock smallBlock = ConsensusTool.getSmallBlock(block); assertNotNull(smallBlock); assertEquals(smallBlock.getHeader(), block.getHeader()); assertEquals(smallBlock.getSubTxList().size() , 0); assertEquals(smallBlock.getTxHashList().get(0), block.getTxs().get(0).getHash()); }
public static SmallBlock getSmallBlock(Block block) { SmallBlock smallBlock = new SmallBlock(); smallBlock.setHeader(block.getHeader()); List<NulsDigestData> txHashList = new ArrayList<>(); for (Transaction tx : block.getTxs()) { txHashList.add(tx.getHash()); if (tx.isSystemTx()) { smallBlock.addBaseTx(tx); } } smallBlock.setTxHashList(txHashList); return smallBlock; }
ConsensusTool { public static SmallBlock getSmallBlock(Block block) { SmallBlock smallBlock = new SmallBlock(); smallBlock.setHeader(block.getHeader()); List<NulsDigestData> txHashList = new ArrayList<>(); for (Transaction tx : block.getTxs()) { txHashList.add(tx.getHash()); if (tx.isSystemTx()) { smallBlock.addBaseTx(tx); } } smallBlock.setTxHashList(txHashList); return smallBlock; } }
ConsensusTool { public static SmallBlock getSmallBlock(Block block) { SmallBlock smallBlock = new SmallBlock(); smallBlock.setHeader(block.getHeader()); List<NulsDigestData> txHashList = new ArrayList<>(); for (Transaction tx : block.getTxs()) { txHashList.add(tx.getHash()); if (tx.isSystemTx()) { smallBlock.addBaseTx(tx); } } smallBlock.setTxHashList(txHashList); return smallBlock; } }
ConsensusTool { public static SmallBlock getSmallBlock(Block block) { SmallBlock smallBlock = new SmallBlock(); smallBlock.setHeader(block.getHeader()); List<NulsDigestData> txHashList = new ArrayList<>(); for (Transaction tx : block.getTxs()) { txHashList.add(tx.getHash()); if (tx.isSystemTx()) { smallBlock.addBaseTx(tx); } } smallBlock.setTxHashList(txHashList); return smallBlock; } static SmallBlock getSmallBlock(Block block); static Block createBlock(BlockData blockData, Account account); static CoinBaseTransaction createCoinBaseTx(MeetingMember member, List<Transaction> txList, MeetingRound localRound, long unlockHeight); static YellowPunishTransaction createYellowPunishTx(Block preBlock, MeetingMember self, MeetingRound round); static CoinData getStopAgentCoinData(Agent agent, long lockTime); static CoinData getStopAgentCoinData(Agent agent, long lockTime, Long hight); static CoinData getStopAgentCoinData(byte[] address, long lockTime); static byte[] getStateRoot(BlockHeader blockHeader); }
ConsensusTool { public static SmallBlock getSmallBlock(Block block) { SmallBlock smallBlock = new SmallBlock(); smallBlock.setHeader(block.getHeader()); List<NulsDigestData> txHashList = new ArrayList<>(); for (Transaction tx : block.getTxs()) { txHashList.add(tx.getHash()); if (tx.isSystemTx()) { smallBlock.addBaseTx(tx); } } smallBlock.setTxHashList(txHashList); return smallBlock; } static SmallBlock getSmallBlock(Block block); static Block createBlock(BlockData blockData, Account account); static CoinBaseTransaction createCoinBaseTx(MeetingMember member, List<Transaction> txList, MeetingRound localRound, long unlockHeight); static YellowPunishTransaction createYellowPunishTx(Block preBlock, MeetingMember self, MeetingRound round); static CoinData getStopAgentCoinData(Agent agent, long lockTime); static CoinData getStopAgentCoinData(Agent agent, long lockTime, Long hight); static CoinData getStopAgentCoinData(byte[] address, long lockTime); static byte[] getStateRoot(BlockHeader blockHeader); }