Search in sources :

Example 1 with FileErrorHandlerContentLineNumber

use of org.pentaho.di.trans.step.errorhandling.FileErrorHandlerContentLineNumber in project pentaho-kettle by pentaho.

the class ExcelInput method initErrorHandling.

private void initErrorHandling() {
    List<FileErrorHandler> errorHandlers = new ArrayList<FileErrorHandler>(2);
    if (meta.getLineNumberFilesDestinationDirectory() != null) {
        errorHandlers.add(new FileErrorHandlerContentLineNumber(getTrans().getCurrentDate(), environmentSubstitute(meta.getLineNumberFilesDestinationDirectory()), meta.getLineNumberFilesExtension(), "Latin1", this));
    }
    if (meta.getErrorFilesDestinationDirectory() != null) {
        errorHandlers.add(new FileErrorHandlerMissingFiles(getTrans().getCurrentDate(), environmentSubstitute(meta.getErrorFilesDestinationDirectory()), meta.getErrorFilesExtension(), "Latin1", this));
    }
    data.errorHandler = new CompositeFileErrorHandler(errorHandlers);
}
Also used : FileErrorHandlerMissingFiles(org.pentaho.di.trans.step.errorhandling.FileErrorHandlerMissingFiles) FileErrorHandlerContentLineNumber(org.pentaho.di.trans.step.errorhandling.FileErrorHandlerContentLineNumber) ArrayList(java.util.ArrayList) CompositeFileErrorHandler(org.pentaho.di.trans.step.errorhandling.CompositeFileErrorHandler) FileErrorHandler(org.pentaho.di.trans.step.errorhandling.FileErrorHandler) CompositeFileErrorHandler(org.pentaho.di.trans.step.errorhandling.CompositeFileErrorHandler)

Example 2 with FileErrorHandlerContentLineNumber

use of org.pentaho.di.trans.step.errorhandling.FileErrorHandlerContentLineNumber in project pentaho-kettle by pentaho.

the class TextFileInput method initErrorHandling.

private void initErrorHandling() {
    List<FileErrorHandler> dataErrorLineHandlers = new ArrayList<FileErrorHandler>(2);
    if (meta.getLineNumberFilesDestinationDirectory() != null) {
        dataErrorLineHandlers.add(new FileErrorHandlerContentLineNumber(getTrans().getCurrentDate(), environmentSubstitute(meta.getLineNumberFilesDestinationDirectory()), meta.getLineNumberFilesExtension(), meta.getEncoding(), this));
    }
    if (meta.getErrorFilesDestinationDirectory() != null) {
        dataErrorLineHandlers.add(new FileErrorHandlerMissingFiles(getTrans().getCurrentDate(), environmentSubstitute(meta.getErrorFilesDestinationDirectory()), meta.getErrorLineFilesExtension(), meta.getEncoding(), this));
    }
    data.dataErrorLineHandler = new CompositeFileErrorHandler(dataErrorLineHandlers);
}
Also used : FileErrorHandlerMissingFiles(org.pentaho.di.trans.step.errorhandling.FileErrorHandlerMissingFiles) FileErrorHandlerContentLineNumber(org.pentaho.di.trans.step.errorhandling.FileErrorHandlerContentLineNumber) ArrayList(java.util.ArrayList) AbstractFileErrorHandler(org.pentaho.di.trans.step.errorhandling.AbstractFileErrorHandler) CompositeFileErrorHandler(org.pentaho.di.trans.step.errorhandling.CompositeFileErrorHandler) FileErrorHandler(org.pentaho.di.trans.step.errorhandling.FileErrorHandler) CompositeFileErrorHandler(org.pentaho.di.trans.step.errorhandling.CompositeFileErrorHandler)

Example 3 with FileErrorHandlerContentLineNumber

use of org.pentaho.di.trans.step.errorhandling.FileErrorHandlerContentLineNumber in project pentaho-kettle by pentaho.

the class BaseFileInputStep method initErrorHandling.

/**
 * Initialize error handling.
 *
 * TODO: should we set charset for error files from content meta ? What about case for automatic charset ?
 */
private void initErrorHandling() {
    List<FileErrorHandler> dataErrorLineHandlers = new ArrayList<FileErrorHandler>(2);
    if (meta.errorHandling.lineNumberFilesDestinationDirectory != null) {
        dataErrorLineHandlers.add(new FileErrorHandlerContentLineNumber(getTrans().getCurrentDate(), environmentSubstitute(meta.errorHandling.lineNumberFilesDestinationDirectory), meta.errorHandling.lineNumberFilesExtension, meta.getEncoding(), this));
    }
    if (meta.errorHandling.errorFilesDestinationDirectory != null) {
        dataErrorLineHandlers.add(new FileErrorHandlerMissingFiles(getTrans().getCurrentDate(), environmentSubstitute(meta.errorHandling.errorFilesDestinationDirectory), meta.errorHandling.errorFilesExtension, meta.getEncoding(), this));
    }
    data.dataErrorLineHandler = new CompositeFileErrorHandler(dataErrorLineHandlers);
}
Also used : FileErrorHandlerMissingFiles(org.pentaho.di.trans.step.errorhandling.FileErrorHandlerMissingFiles) FileErrorHandlerContentLineNumber(org.pentaho.di.trans.step.errorhandling.FileErrorHandlerContentLineNumber) ArrayList(java.util.ArrayList) CompositeFileErrorHandler(org.pentaho.di.trans.step.errorhandling.CompositeFileErrorHandler) FileErrorHandler(org.pentaho.di.trans.step.errorhandling.FileErrorHandler) CompositeFileErrorHandler(org.pentaho.di.trans.step.errorhandling.CompositeFileErrorHandler)

Aggregations

ArrayList (java.util.ArrayList)3 CompositeFileErrorHandler (org.pentaho.di.trans.step.errorhandling.CompositeFileErrorHandler)3 FileErrorHandler (org.pentaho.di.trans.step.errorhandling.FileErrorHandler)3 FileErrorHandlerContentLineNumber (org.pentaho.di.trans.step.errorhandling.FileErrorHandlerContentLineNumber)3 FileErrorHandlerMissingFiles (org.pentaho.di.trans.step.errorhandling.FileErrorHandlerMissingFiles)3 AbstractFileErrorHandler (org.pentaho.di.trans.step.errorhandling.AbstractFileErrorHandler)1