public TextOneFileSelector( String sourcefolderin, String sourcefilenamein, String destfolderin ) { if ( !Utils.isEmpty( sourcefilenamein ) ) { filename = sourcefilenamein; } if ( !Utils.isEmpty( sourcefolderin ) ) { foldername = sourcefolderin; } if ( !Utils.isEmpty( destfolderin ) ) { destfolder = destfolderin; } }
@Override public BigDecimal getBigNumber() { if ( Utils.isEmpty( string ) ) { return null; } // Localise , to . if ( Const.DEFAULT_DECIMAL_SEPARATOR != '.' ) { string = string.replace( Const.DEFAULT_DECIMAL_SEPARATOR, '.' ); } return new BigDecimal( string ); }
@Override public void write( byte[] b ) throws IOException { if ( Utils.isEmpty( encoding ) ) { writer.append( new String( b ) ); } else { writer.append( new String( b, encoding ) ); } }
@Override public String getURL( String hostname, String port, String databaseName ) { if ( !Utils.isEmpty( port ) && Const.toInt( port, -1 ) > 0 ) { return "jdbc:luciddb:http://" + hostname + ":" + port; } else { return "jdbc:luciddb:http://" + hostname; } }
@Override public void focusGained( org.eclipse.swt.events.FocusEvent e ) { // check if the URL and login credentials passed and not just had error if ( Utils.isEmpty( wURL.getText() ) || Utils.isEmpty( wUserName.getText() ) || Utils.isEmpty( wPassword.getText() ) || ( getModulesListError ) ) { return; } getModulesList(); } } );
public static String getPortSpecification( VariableSpace space, String port ) { String realPort = space.environmentSubstitute( port ); String portSpec = ":" + realPort; if ( Utils.isEmpty( realPort ) || port.equals( "80" ) ) { portSpec = ""; } return portSpec; }
public static String createEntryKey( String connectionGroup, String partitionID, Database database ) { StringBuilder key = new StringBuilder( connectionGroup ); key.append( ':' ).append( database.getDatabaseMeta().getName() ); if ( !Utils.isEmpty( partitionID ) ) { key.append( ':' ).append( partitionID ); } return key.toString(); }
private void ok() { if ( Utils.isEmpty( wStepname.getText() ) ) { return; } // Get the information for the dialog into the input structure. getInfo( input ); dispose(); }
private void ok() { if ( Utils.isEmpty( wStepname.getText() ) ) { return; } stepname = wStepname.getText(); // return value input.setMessageField( wMessageField.getText() ); dispose(); } }
@Override public ObjectId renameJob( ObjectId id_job, String versionComment, RepositoryDirectoryInterface newDir, String newName ) throws KettleException { ObjectId objectId = renameObject( id_job, newDir, newName, EXT_JOB ); if ( !Utils.isEmpty( versionComment ) ) { insertLogEntry( "Rename job : " + versionComment ); } return objectId; }
public String getFieldDefinition( ValueMetaInterface v, String tk, String pk, boolean use_autoinc, boolean add_fieldname, boolean add_cr ) { String definition = v.getDatabaseColumnTypeDefinition( databaseInterface, tk, pk, use_autoinc, add_fieldname, add_cr ); if ( !Utils.isEmpty( definition ) ) { return definition; } return databaseInterface.getFieldDefinition( v, tk, pk, use_autoinc, add_fieldname, add_cr ); }
/** * Overrides parent behavior to allow <code>getDatabasePortNumberString</code> value to override value of * <code>DBS_PORT</code> extra option. */ @Override public Map<String, String> getExtraOptions() { Map<String, String> map = super.getExtraOptions(); if ( !Utils.isEmpty( getDatabasePortNumberString() ) ) { map.put( getPluginId() + ".DBS_PORT", getDatabasePortNumberString() ); } return map; }
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { // Output field (String) if ( !Utils.isEmpty( resultfieldname ) ) { ValueMetaInterface v = new ValueMetaBoolean( space.environmentSubstitute( resultfieldname ) ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } }
private TransMeta loadTransformation( ReportSubjectLocation location ) throws KettleException { TransMeta transMeta; if ( !Utils.isEmpty( location.getFilename() ) ) { transMeta = new TransMeta( location.getFilename() ); } else { transMeta = repository.loadTransformation( location.getName(), location.getDirectory(), null, true, null ); } return transMeta; }
private JobMeta loadJob( ReportSubjectLocation location ) throws KettleException { JobMeta jobMeta; if ( !Utils.isEmpty( location.getFilename() ) ) { jobMeta = new JobMeta( location.getFilename(), repository ); } else { jobMeta = repository.loadJob( location.getName(), location.getDirectory(), null, null ); } return jobMeta; }
public void truncateTable( String schema, String tablename ) throws KettleDatabaseException { if ( Utils.isEmpty( connectionGroup ) ) { String truncateStatement = databaseMeta.getTruncateTableStatement( schema, tablename ); if ( truncateStatement == null ) { throw new KettleDatabaseException( "Truncate table not supported by " + databaseMeta.getDatabaseInterface().getPluginName() ); } execStatement( truncateStatement ); } else { execStatement( "DELETE FROM " + databaseMeta.getQuotedSchemaTableCombination( schema, tablename ) ); } }
private boolean checkUser() { if ( Utils.isEmpty( wUserName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "SalesforceUpdateDialog.UsernameMissing.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); return false; } return true; }
private boolean checkUser() { if ( Utils.isEmpty( wUserName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "SalesforceInsertDialog.UsernameMissing.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); return false; } return true; }