@Test public void getFieldsTest() throws KettleStepException { GetSubFoldersMeta stepMeta = new GetSubFoldersMeta(); String stepName = UUID.randomUUID().toString(); RowMeta rowMeta = new RowMeta(); stepMeta.getFields( rowMeta, stepName, null, null, new Variables(), null, null ); assertFalse( stepMeta.includeRowNumber() ); assertEquals( 10, rowMeta.size() ); assertEquals( "folderName", rowMeta.getValueMeta( 0 ).getName() ); assertEquals( "short_folderName", rowMeta.getValueMeta( 1 ).getName() ); assertEquals( "path", rowMeta.getValueMeta( 2 ).getName() ); assertEquals( "ishidden", rowMeta.getValueMeta( 3 ).getName() ); assertEquals( "isreadable", rowMeta.getValueMeta( 4 ).getName() ); assertEquals( "iswriteable", rowMeta.getValueMeta( 5 ).getName() ); assertEquals( "lastmodifiedtime", rowMeta.getValueMeta( 6 ).getName() ); assertEquals( "uri", rowMeta.getValueMeta( 7 ).getName() ); assertEquals( "rooturi", rowMeta.getValueMeta( 8 ).getName() ); assertEquals( "childrens", rowMeta.getValueMeta( 9 ).getName() ); stepMeta.setIncludeRowNumber( true ); rowMeta = new RowMeta(); stepMeta.getFields( rowMeta, stepName, null, null, new Variables(), null, null ); assertTrue( stepMeta.includeRowNumber() ); assertEquals( 11, rowMeta.size() ); assertEquals( "folderName", rowMeta.getValueMeta( 0 ).getName() ); assertEquals( "short_folderName", rowMeta.getValueMeta( 1 ).getName() ); assertEquals( "path", rowMeta.getValueMeta( 2 ).getName() ); assertEquals( "ishidden", rowMeta.getValueMeta( 3 ).getName() ); assertEquals( "isreadable", rowMeta.getValueMeta( 4 ).getName() ); assertEquals( "iswriteable", rowMeta.getValueMeta( 5 ).getName() ); assertEquals( "lastmodifiedtime", rowMeta.getValueMeta( 6 ).getName() ); assertEquals( "uri", rowMeta.getValueMeta( 7 ).getName() ); assertEquals( "rooturi", rowMeta.getValueMeta( 8 ).getName() ); assertEquals( "childrens", rowMeta.getValueMeta( 9 ).getName() ); assertEquals( null, rowMeta.getValueMeta( 10 ).getName() ); stepMeta.setRowNumberField( "MyRowNumber" ); rowMeta = new RowMeta(); stepMeta.getFields( rowMeta, stepName, null, null, new Variables(), null, null ); assertEquals( "MyRowNumber", stepMeta.getRowNumberField() ); assertEquals( 11, rowMeta.size() ); assertEquals( "MyRowNumber", rowMeta.getValueMeta( 10 ).getName() ); }
public void getFields( RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { ValueMetaInterface folderName = new ValueMetaString( "folderName" ); folderName.setLength( 500 ); folderName.setPrecision( -1 ); folderName.setOrigin( name ); row.addValueMeta( folderName ); ValueMetaInterface short_folderName = new ValueMetaString( "short_folderName" ); short_folderName.setLength( 500 ); short_folderName.setPrecision( -1 ); short_folderName.setOrigin( name ); row.addValueMeta( short_folderName ); ValueMetaInterface path = new ValueMetaString( "path" ); path.setLength( 500 ); path.setPrecision( -1 ); path.setOrigin( name ); row.addValueMeta( path ); ValueMetaInterface ishidden = new ValueMetaBoolean( "ishidden" ); ishidden.setOrigin( name ); row.addValueMeta( ishidden ); ValueMetaInterface isreadable = new ValueMetaBoolean( "isreadable" ); isreadable.setOrigin( name ); row.addValueMeta( isreadable ); ValueMetaInterface iswriteable = new ValueMetaBoolean( "iswriteable" ); iswriteable.setOrigin( name ); row.addValueMeta( iswriteable ); ValueMetaInterface lastmodifiedtime = new ValueMetaDate( "lastmodifiedtime" ); lastmodifiedtime.setOrigin( name ); row.addValueMeta( lastmodifiedtime ); ValueMetaInterface uri = new ValueMetaString( "uri" ); uri.setOrigin( name ); row.addValueMeta( uri ); ValueMetaInterface rooturi = new ValueMetaString( "rooturi" ); rooturi.setOrigin( name ); row.addValueMeta( rooturi ); ValueMetaInterface childrens = new ValueMetaInteger( space.environmentSubstitute( "childrens" ) ); childrens.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 ); childrens.setOrigin( name ); row.addValueMeta( childrens ); if ( includeRowNumber ) { ValueMetaInterface v = new ValueMetaInteger( space.environmentSubstitute( rowNumberField ) ); v.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 ); v.setOrigin( name ); row.addValueMeta( v ); } }
GetSubFoldersMeta extends BaseStepMeta implements StepMetaInterface { public void getFields( RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { ValueMetaInterface folderName = new ValueMetaString( "folderName" ); folderName.setLength( 500 ); folderName.setPrecision( -1 ); folderName.setOrigin( name ); row.addValueMeta( folderName ); ValueMetaInterface short_folderName = new ValueMetaString( "short_folderName" ); short_folderName.setLength( 500 ); short_folderName.setPrecision( -1 ); short_folderName.setOrigin( name ); row.addValueMeta( short_folderName ); ValueMetaInterface path = new ValueMetaString( "path" ); path.setLength( 500 ); path.setPrecision( -1 ); path.setOrigin( name ); row.addValueMeta( path ); ValueMetaInterface ishidden = new ValueMetaBoolean( "ishidden" ); ishidden.setOrigin( name ); row.addValueMeta( ishidden ); ValueMetaInterface isreadable = new ValueMetaBoolean( "isreadable" ); isreadable.setOrigin( name ); row.addValueMeta( isreadable ); ValueMetaInterface iswriteable = new ValueMetaBoolean( "iswriteable" ); iswriteable.setOrigin( name ); row.addValueMeta( iswriteable ); ValueMetaInterface lastmodifiedtime = new ValueMetaDate( "lastmodifiedtime" ); lastmodifiedtime.setOrigin( name ); row.addValueMeta( lastmodifiedtime ); ValueMetaInterface uri = new ValueMetaString( "uri" ); uri.setOrigin( name ); row.addValueMeta( uri ); ValueMetaInterface rooturi = new ValueMetaString( "rooturi" ); rooturi.setOrigin( name ); row.addValueMeta( rooturi ); ValueMetaInterface childrens = new ValueMetaInteger( space.environmentSubstitute( "childrens" ) ); childrens.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 ); childrens.setOrigin( name ); row.addValueMeta( childrens ); if ( includeRowNumber ) { ValueMetaInterface v = new ValueMetaInteger( space.environmentSubstitute( rowNumberField ) ); v.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 ); v.setOrigin( name ); row.addValueMeta( v ); } } }
GetSubFoldersMeta extends BaseStepMeta implements StepMetaInterface { public void getFields( RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { ValueMetaInterface folderName = new ValueMetaString( "folderName" ); folderName.setLength( 500 ); folderName.setPrecision( -1 ); folderName.setOrigin( name ); row.addValueMeta( folderName ); ValueMetaInterface short_folderName = new ValueMetaString( "short_folderName" ); short_folderName.setLength( 500 ); short_folderName.setPrecision( -1 ); short_folderName.setOrigin( name ); row.addValueMeta( short_folderName ); ValueMetaInterface path = new ValueMetaString( "path" ); path.setLength( 500 ); path.setPrecision( -1 ); path.setOrigin( name ); row.addValueMeta( path ); ValueMetaInterface ishidden = new ValueMetaBoolean( "ishidden" ); ishidden.setOrigin( name ); row.addValueMeta( ishidden ); ValueMetaInterface isreadable = new ValueMetaBoolean( "isreadable" ); isreadable.setOrigin( name ); row.addValueMeta( isreadable ); ValueMetaInterface iswriteable = new ValueMetaBoolean( "iswriteable" ); iswriteable.setOrigin( name ); row.addValueMeta( iswriteable ); ValueMetaInterface lastmodifiedtime = new ValueMetaDate( "lastmodifiedtime" ); lastmodifiedtime.setOrigin( name ); row.addValueMeta( lastmodifiedtime ); ValueMetaInterface uri = new ValueMetaString( "uri" ); uri.setOrigin( name ); row.addValueMeta( uri ); ValueMetaInterface rooturi = new ValueMetaString( "rooturi" ); rooturi.setOrigin( name ); row.addValueMeta( rooturi ); ValueMetaInterface childrens = new ValueMetaInteger( space.environmentSubstitute( "childrens" ) ); childrens.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 ); childrens.setOrigin( name ); row.addValueMeta( childrens ); if ( includeRowNumber ) { ValueMetaInterface v = new ValueMetaInteger( space.environmentSubstitute( rowNumberField ) ); v.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 ); v.setOrigin( name ); row.addValueMeta( v ); } } GetSubFoldersMeta(); }
GetSubFoldersMeta extends BaseStepMeta implements StepMetaInterface { public void getFields( RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { ValueMetaInterface folderName = new ValueMetaString( "folderName" ); folderName.setLength( 500 ); folderName.setPrecision( -1 ); folderName.setOrigin( name ); row.addValueMeta( folderName ); ValueMetaInterface short_folderName = new ValueMetaString( "short_folderName" ); short_folderName.setLength( 500 ); short_folderName.setPrecision( -1 ); short_folderName.setOrigin( name ); row.addValueMeta( short_folderName ); ValueMetaInterface path = new ValueMetaString( "path" ); path.setLength( 500 ); path.setPrecision( -1 ); path.setOrigin( name ); row.addValueMeta( path ); ValueMetaInterface ishidden = new ValueMetaBoolean( "ishidden" ); ishidden.setOrigin( name ); row.addValueMeta( ishidden ); ValueMetaInterface isreadable = new ValueMetaBoolean( "isreadable" ); isreadable.setOrigin( name ); row.addValueMeta( isreadable ); ValueMetaInterface iswriteable = new ValueMetaBoolean( "iswriteable" ); iswriteable.setOrigin( name ); row.addValueMeta( iswriteable ); ValueMetaInterface lastmodifiedtime = new ValueMetaDate( "lastmodifiedtime" ); lastmodifiedtime.setOrigin( name ); row.addValueMeta( lastmodifiedtime ); ValueMetaInterface uri = new ValueMetaString( "uri" ); uri.setOrigin( name ); row.addValueMeta( uri ); ValueMetaInterface rooturi = new ValueMetaString( "rooturi" ); rooturi.setOrigin( name ); row.addValueMeta( rooturi ); ValueMetaInterface childrens = new ValueMetaInteger( space.environmentSubstitute( "childrens" ) ); childrens.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 ); childrens.setOrigin( name ); row.addValueMeta( childrens ); if ( includeRowNumber ) { ValueMetaInterface v = new ValueMetaInteger( space.environmentSubstitute( rowNumberField ) ); v.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 ); v.setOrigin( name ); row.addValueMeta( v ); } } GetSubFoldersMeta(); String getRequiredFilesDesc( String tt ); String getRowNumberField(); void setDynamicFoldernameField( String dynamicFoldernameField ); void setRowNumberField( String rowNumberField ); String getDynamicFoldernameField(); boolean includeRowNumber(); boolean isFoldernameDynamic(); void setFolderField( boolean isFoldernameDynamic ); void setIncludeRowNumber( boolean includeRowNumber ); String[] getFolderRequired(); String getRequiredFoldersCode( String tt ); void setFolderRequired( String[] folderRequiredin ); String[] getFolderName(); void setFolderName( String[] folderName ); long getRowLimit(); void setRowLimit( long rowLimit ); void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); Object clone(); void allocate( int nrfiles ); void setDefault(); void getFields( RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ); String getXML(); void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); FileInputList getFolderList( VariableSpace space ); FileInputList getDynamicFolderList( VariableSpace space, String[] folderName, String[] folderRequired ); void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ); StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr,
    TransMeta transMeta, Trans trans ); StepDataInterface getStepData(); String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
    ResourceNamingInterface resourceNamingInterface, Repository repository, IMetaStore metaStore ); }
GetSubFoldersMeta extends BaseStepMeta implements StepMetaInterface { public void getFields( RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { ValueMetaInterface folderName = new ValueMetaString( "folderName" ); folderName.setLength( 500 ); folderName.setPrecision( -1 ); folderName.setOrigin( name ); row.addValueMeta( folderName ); ValueMetaInterface short_folderName = new ValueMetaString( "short_folderName" ); short_folderName.setLength( 500 ); short_folderName.setPrecision( -1 ); short_folderName.setOrigin( name ); row.addValueMeta( short_folderName ); ValueMetaInterface path = new ValueMetaString( "path" ); path.setLength( 500 ); path.setPrecision( -1 ); path.setOrigin( name ); row.addValueMeta( path ); ValueMetaInterface ishidden = new ValueMetaBoolean( "ishidden" ); ishidden.setOrigin( name ); row.addValueMeta( ishidden ); ValueMetaInterface isreadable = new ValueMetaBoolean( "isreadable" ); isreadable.setOrigin( name ); row.addValueMeta( isreadable ); ValueMetaInterface iswriteable = new ValueMetaBoolean( "iswriteable" ); iswriteable.setOrigin( name ); row.addValueMeta( iswriteable ); ValueMetaInterface lastmodifiedtime = new ValueMetaDate( "lastmodifiedtime" ); lastmodifiedtime.setOrigin( name ); row.addValueMeta( lastmodifiedtime ); ValueMetaInterface uri = new ValueMetaString( "uri" ); uri.setOrigin( name ); row.addValueMeta( uri ); ValueMetaInterface rooturi = new ValueMetaString( "rooturi" ); rooturi.setOrigin( name ); row.addValueMeta( rooturi ); ValueMetaInterface childrens = new ValueMetaInteger( space.environmentSubstitute( "childrens" ) ); childrens.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 ); childrens.setOrigin( name ); row.addValueMeta( childrens ); if ( includeRowNumber ) { ValueMetaInterface v = new ValueMetaInteger( space.environmentSubstitute( rowNumberField ) ); v.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 ); v.setOrigin( name ); row.addValueMeta( v ); } } GetSubFoldersMeta(); String getRequiredFilesDesc( String tt ); String getRowNumberField(); void setDynamicFoldernameField( String dynamicFoldernameField ); void setRowNumberField( String rowNumberField ); String getDynamicFoldernameField(); boolean includeRowNumber(); boolean isFoldernameDynamic(); void setFolderField( boolean isFoldernameDynamic ); void setIncludeRowNumber( boolean includeRowNumber ); String[] getFolderRequired(); String getRequiredFoldersCode( String tt ); void setFolderRequired( String[] folderRequiredin ); String[] getFolderName(); void setFolderName( String[] folderName ); long getRowLimit(); void setRowLimit( long rowLimit ); void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); Object clone(); void allocate( int nrfiles ); void setDefault(); void getFields( RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ); String getXML(); void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); FileInputList getFolderList( VariableSpace space ); FileInputList getDynamicFolderList( VariableSpace space, String[] folderName, String[] folderRequired ); void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ); StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr,
    TransMeta transMeta, Trans trans ); StepDataInterface getStepData(); String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
    ResourceNamingInterface resourceNamingInterface, Repository repository, IMetaStore metaStore ); static final String[] RequiredFoldersDesc; static final String[] RequiredFoldersCode; static final String NO; }