Class BaseFileInputStep<M extends BaseFileInputMeta<?,​?,​?>,​D extends BaseFileInputStepData>

    • Method Detail

      • init

        protected abstract boolean init()
        Content-dependent initialization.
      • createReader

        protected abstract IBaseFileInputReader createReader​(M meta,
                                                             D data,
                                                             org.apache.commons.vfs2.FileObject file)
                                                      throws Exception
        Create reader for specific file.
        Throws:
        Exception
      • openNextFile

        protected boolean openNextFile()
        Open next VFS file for processing. This method will support different parallelization methods later.
      • handleOpenFileException

        protected boolean handleOpenFileException​(Exception e)
      • processRow

        public boolean processRow​(StepMetaInterface smi,
                                  StepDataInterface sdi)
                           throws org.pentaho.di.core.exception.KettleException
        Process next row. This methods opens next file automatically.
        Specified by:
        processRow in interface StepInterface
        Overrides:
        processRow in class BaseStep
        Parameters:
        smi - The steps metadata to work with
        sdi - The steps temporary working data to work with (database connections, result sets, caches, temporary variables, etc.)
        Returns:
        false if no more rows can be processed or an error occurred.
        Throws:
        org.pentaho.di.core.exception.KettleException
      • prepareToRowProcessing

        protected void prepareToRowProcessing()
                                       throws org.pentaho.di.core.exception.KettleException
        Prepare to process. Executed only first time row processing. It can't be possible to prepare to process in the init() phrase, because files can be in fields from previous step.
        Throws:
        org.pentaho.di.core.exception.KettleException
      • closeLastFile

        protected void closeLastFile()
        Close last opened file/
      • failAfterBadFile

        public boolean failAfterBadFile​(String errorMsg)
        Specified by:
        failAfterBadFile in interface IBaseFileInputStepControl
        Parameters:
        errorMsg - Message to send to rejected row if enabled
        Returns:
        If should stop processing after having problems with a file
      • fillFileAdditionalFields

        protected void fillFileAdditionalFields​(D data,
                                                org.apache.commons.vfs2.FileObject file)
                                         throws org.apache.commons.vfs2.FileSystemException
        Prepare file-dependent data for fill additional fields.
        Throws:
        org.apache.commons.vfs2.FileSystemException