AnsweredAssumed Answered

Get File Count in SFTP directory

Question asked by bbelous371489 on Apr 27, 2018
Latest reply on Apr 27, 2018 by bbelous371489

Hello.

 

I am trying to get the file count in the SFTP directory.

 

I am using the Data Process shape with a custom Groovy script as this:

 

import java.util.Properties;
import java.io.InputStream;
import com.boomi.execution.ExecutionUtil;
import com.boomi.execution.ExecutionManager;


// Get file count
ExecutionUtil.setDynamicProcessProperty("FILE_COUNT", String.valueOf(dataContext.getDataCount()), false);

// Leave the rest of the script as-is...
for ( int i = 0; i < dataContext.getDataCount(); i++ ) {
   InputStream is = dataContext.getStream(i);
   Properties props = dataContext.getProperties(i);
 
   dataContext.storeStream(is, props);
}

 

 

 

However, the FILE_COUNT dynamic process property always resolves to "1".

 

Any idea what I am doing wrong?

 

Thanks

Boris

Attachments

Outcomes