public static void getUsedVariables( String aString, List<String> list, boolean includeSystemVariables ) { getUsedVariables( aString, UNIX_OPEN, UNIX_CLOSE, list, includeSystemVariables ); getUsedVariables( aString, WINDOWS_OPEN, WINDOWS_CLOSE, list, includeSystemVariables ); }
/** * Substitutes variables in <code>aString</code> with the environment values in the system properties * * @param aString * the string on which to apply the substitution. * @param systemProperties * the system properties to use * @return the string with the substitution applied. */ public static final synchronized String environmentSubstitute( String aString, Map<String, String> systemProperties ) { Map<String, String> sysMap = new HashMap<String, String>(); synchronized ( sysMap ) { sysMap.putAll( Collections.synchronizedMap( systemProperties ) ); aString = substituteWindows( aString, sysMap ); aString = substituteUnix( aString, sysMap ); aString = substituteHex( aString ); return aString; } }
@Override public void verifyText( VerifyEvent e ) { if ( !StringUtil.isEmpty( e.text ) && !StringUtil.isVariable( e.text ) && !StringUtil.IsInteger( e.text ) ) { e.doit = false; } } } );
public String getHostNameParsed( VariableSpace variableSpace ) { if ( StringUtil.isVariable( hdfsHost ) ) { if ( variableSpace == null ) { return null; } return variableSpace.getVariable( StringUtil.getVariableName( getHdfsHost() ) ); } return hdfsHost != null ? hdfsHost.trim() : null; }
public void setParquetVersion( String value ) { parquetVersion = StringUtil.isVariable( value ) ? value : parseFromToString( value, ParquetVersion.values(), CompressionType.NONE ).name(); }
@Deprecated public static final String[] guessStringsFromLine( LogChannelInterface log, String line, TextFileInputMeta inf, String delimiter ) throws KettleException { return guessStringsFromLine( new Variables(), log, line, inf, delimiter, StringUtil.substituteHex( inf .getEnclosure() ), StringUtil.substituteHex( inf.getEscapeCharacter() ) ); }
String variableName = StringUtil.getVariableName( Const.NVL( getVariableName(), "" ) ); String variableName = StringUtil.getVariableName( variablename ); if ( System.getProperty( variableName ) == null ) { success = true;
@Override public void verifyText( VerifyEvent e ) { if ( !StringUtil.isEmpty( e.text ) && !StringUtil.isVariable( e.text ) && !StringUtil.IsInteger( e.text ) ) { e.doit = false; } } } );
if ( StringUtil.isVariable( scheme ) ) { scheme = variableSpace.getVariable( StringUtil.getVariableName( scheme ) ) != null ? variableSpace .environmentSubstitute( scheme ) : null; if ( StringUtil.isVariable( ncHostname ) ) { ncHostname = variableSpace.getVariable( StringUtil.getVariableName( ncHostname ) ) != null ? variableSpace .environmentSubstitute( ncHostname ) : null; if ( StringUtil.isVariable( ncPort ) ) { ncPort = variableSpace.getVariable( StringUtil.getVariableName( ncPort ) ) != null ? variableSpace .environmentSubstitute( ncPort ) : null; if ( StringUtil.isVariable( ncUsername ) ) { ncUsername = variableSpace.getVariable( StringUtil.getVariableName( ncUsername ) ) != null ? variableSpace .environmentSubstitute( ncUsername ) : null; if ( StringUtil.isVariable( ncPassword ) ) { ncPassword = variableSpace.getVariable( StringUtil.getVariableName( ncPassword ) ) != null ? variableSpace .environmentSubstitute( ncPassword ) : null;
public String getParquetVersion() { return StringUtil.isVariable( parquetVersion ) ? parquetVersion : getParquetVersion( null ).toString(); }
/** * @deprecated Use {@link #convertLineToRow(LogChannelInterface, TextFileLine, * InputFileMetaInterface, Object[], int, RowMetaInterface,RowMetaInterface, * String, long, String, String, String, FileErrorHandler, boolean, boolean, * boolean, boolean, boolean, boolean, boolean, boolean, String, String, boolean, * Date, String, String, String, long)} instead. */ @Deprecated public static final Object[] convertLineToRow( LogChannelInterface log, TextFileLine textFileLine, InputFileMetaInterface info, RowMetaInterface outputRowMeta, RowMetaInterface convertRowMeta, String fname, long rowNr, String delimiter, FileErrorHandler errorHandler, boolean addShortFilename, boolean addExtension, boolean addPath, boolean addSize, boolean addIsHidden, boolean addLastModificationDate, boolean addUri, boolean addRootUri, String shortFilename, String path, boolean hidden, Date modificationDateTime, String uri, String rooturi, String extension, long size ) throws KettleException { return convertLineToRow( log, textFileLine, info, null, 0, outputRowMeta, convertRowMeta, fname, rowNr, delimiter, StringUtil.substituteHex( info.getEnclosure() ), StringUtil.substituteHex( info.getEscapeCharacter() ), errorHandler, addShortFilename, addExtension, addPath, addSize, addIsHidden, addLastModificationDate, addUri, addRootUri, shortFilename, path, hidden, modificationDateTime, uri, rooturi, extension, size ); }
public static boolean isPluginDocumented( PluginInterface plugin ) { if ( plugin == null ) { return false; } return !StringUtil.isEmpty( plugin.getDocumentationUrl() ); }
@Override public void verifyText( VerifyEvent e ) { if ( !StringUtil.isEmpty( e.text ) && !StringUtil.isVariable( e.text ) && !StringUtil.IsInteger( e.text ) ) { e.doit = false; } } } );
if ( StringUtil.isVariable( scheme ) ) { scheme = variableSpace.getVariable( StringUtil.getVariableName( scheme ) ) != null ? variableSpace .environmentSubstitute( scheme ) : null; if ( StringUtil.isVariable( ncHostname ) ) { ncHostname = variableSpace.getVariable( StringUtil.getVariableName( ncHostname ) ) != null ? variableSpace .environmentSubstitute( ncHostname ) : null; if ( StringUtil.isVariable( ncPort ) ) { ncPort = variableSpace.getVariable( StringUtil.getVariableName( ncPort ) ) != null ? variableSpace .environmentSubstitute( ncPort ) : null; if ( StringUtil.isVariable( ncUsername ) ) { ncUsername = variableSpace.getVariable( StringUtil.getVariableName( ncUsername ) ) != null ? variableSpace .environmentSubstitute( ncUsername ) : null; if ( StringUtil.isVariable( ncPassword ) ) { ncPassword = variableSpace.getVariable( StringUtil.getVariableName( ncPassword ) ) != null ? variableSpace .environmentSubstitute( ncPassword ) : null;
private static boolean containsVariables( String entryPath ) { List<String> variablesList = new ArrayList<String>(); StringUtil.getUsedVariables( entryPath, variablesList, true ); return !variablesList.isEmpty(); }
public String getCompressionType() { return StringUtil.isVariable( compressionType ) ? compressionType : getCompressionType( null ).toString(); }
.substituteHex( meta.content.enclosure ), StringUtil.substituteHex( meta.content.escapeCharacter ) );
@Override public void modifyText( ModifyEvent modifyEvent ) { wOK.setEnabled( !StringUtil.isEmpty( wFieldname.getText() ) ); } };
private static boolean containsVariables( String entryPath ) { List<String> variablesList = new ArrayList<String>(); StringUtil.getUsedVariables( entryPath, variablesList, true ); return !variablesList.isEmpty(); } }