use of org.apache.hop.pipeline.transform.errorhandling.IFileErrorHandler in project hop by apache.
the class BaseFileInputTransform method initErrorHandling.
/**
* Initialize error handling.
*
* <p>TODO: should we set charset for error files from content meta ? What about case for
* automatic charset ?
*/
private void initErrorHandling() {
List<IFileErrorHandler> dataErrorLineHandlers = new ArrayList<>(2);
if (meta.errorHandling.lineNumberFilesDestinationDirectory != null) {
dataErrorLineHandlers.add(new FileErrorHandlerContentLineNumber(getPipeline().getExecutionStartDate(), resolve(meta.errorHandling.lineNumberFilesDestinationDirectory), meta.errorHandling.lineNumberFilesExtension, meta.getEncoding(), this));
}
if (meta.errorHandling.errorFilesDestinationDirectory != null) {
dataErrorLineHandlers.add(new FileErrorHandlerMissingFiles(getPipeline().getExecutionStartDate(), resolve(meta.errorHandling.errorFilesDestinationDirectory), meta.errorHandling.errorFilesExtension, meta.getEncoding(), this));
}
data.dataErrorLineHandler = new CompositeFileErrorHandler(dataErrorLineHandlers);
}
use of org.apache.hop.pipeline.transform.errorhandling.IFileErrorHandler in project hop by apache.
the class ExcelInput method initErrorHandling.
private void initErrorHandling() {
List<IFileErrorHandler> errorHandlers = new ArrayList<>(2);
if (meta.getLineNumberFilesDestinationDirectory() != null) {
errorHandlers.add(new FileErrorHandlerContentLineNumber(getPipeline().getExecutionStartDate(), resolve(meta.getLineNumberFilesDestinationDirectory()), meta.getLineNumberFilesExtension(), "Latin1", this));
}
if (meta.getErrorFilesDestinationDirectory() != null) {
errorHandlers.add(new FileErrorHandlerMissingFiles(getPipeline().getExecutionStartDate(), resolve(meta.getErrorFilesDestinationDirectory()), meta.getErrorFilesExtension(), "Latin1", this));
}
data.errorHandler = new CompositeFileErrorHandler(errorHandlers);
}
Aggregations