@Test public void testGetXmlWorksIfWeUpdateOnlyPartOfInputFilesInformation() throws Exception { inputMeta.inputFiles = new BaseFileInputFiles(); inputMeta.inputFiles.fileName = new String[] { FILE_NAME_VALID_PATH }; inputMeta.getXML(); assertEquals( inputMeta.inputFiles.fileName.length, inputMeta.inputFiles.fileMask.length ); assertEquals( inputMeta.inputFiles.fileName.length, inputMeta.inputFiles.excludeFileMask.length ); assertEquals( inputMeta.inputFiles.fileName.length, inputMeta.inputFiles.fileRequired.length ); assertEquals( inputMeta.inputFiles.fileName.length, inputMeta.inputFiles.includeSubFolders.length ); }
@Override public String getXML() { StringBuilder retval = new StringBuilder( 1500 ); retval.append( " " ).append( XMLHandler.addTagValue( "accept_filenames", inputFiles.acceptingFilenames ) ); retval.append( " " ).append( XMLHandler.addTagValue( "passing_through_fields", inputFiles.passingThruFields ) ); retval.append( " " ).append( XMLHandler.addTagValue( "accept_field", inputFiles.acceptingField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "accept_stepname", ( acceptingStep != null ? acceptingStep .getName() : "" ) ) ); retval.append( " " ).append( XMLHandler.addTagValue( "separator", content.separator ) ); retval.append( " " ).append( XMLHandler.addTagValue( "enclosure", content.enclosure ) ); retval.append( " " ).append( XMLHandler.addTagValue( "enclosure_breaks", content.breakInEnclosureAllowed ) ); retval.append( " " ).append( XMLHandler.addTagValue( "escapechar", content.escapeCharacter ) ); retval.append( " " ).append( XMLHandler.addTagValue( "header", content.header ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_headerlines", content.nrHeaderLines ) ); retval.append( " " ).append( XMLHandler.addTagValue( "footer", content.footer ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_footerlines", content.nrFooterLines ) ); retval.append( " " ).append( XMLHandler.addTagValue( "line_wrapped", content.lineWrapped ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_wraps", content.nrWraps ) ); retval.append( " " ).append( XMLHandler.addTagValue( "layout_paged", content.layoutPaged ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_lines_per_page", content.nrLinesPerPage ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_lines_doc_header", content.nrLinesDocHeader ) ); retval.append( " " ).append( XMLHandler.addTagValue( "noempty", content.noEmptyLines ) ); retval.append( " " ).append( XMLHandler.addTagValue( "include", content.includeFilename ) ); retval.append( " " ).append( XMLHandler.addTagValue( "include_field", content.filenameField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rownum", content.includeRowNumber ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rownumByFile", content.rowNumberByFile ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rownum_field", content.rowNumberField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "format", content.fileFormat ) ); retval.append( " " ).append( XMLHandler.addTagValue( "encoding", content.encoding ) ); retval.append( " " ).append( XMLHandler.addTagValue( "length", content.length ) ); retval.append( " " + XMLHandler.addTagValue( "add_to_result_filenames", inputFiles.isaddresult ) ); retval.append( " <file>" ).append( Const.CR ); inputFiles.normalizeAllocation( inputFiles.fileName.length ); for ( int i = 0; i < inputFiles.fileName.length; i++ ) { saveSource( retval, inputFiles.fileName[i] ); parentStepMeta.getParentTransMeta().getNamedClusterEmbedManager().registerUrl( inputFiles.fileName[i] ); retval.append( " " ).append( XMLHandler.addTagValue( "filemask", inputFiles.fileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "exclude_filemask", inputFiles.excludeFileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "file_required", inputFiles.fileRequired[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "include_subfolders", inputFiles.includeSubFolders[i] ) ); } retval.append( " " ).append( XMLHandler.addTagValue( "type", content.fileType ) ); retval.append( " " ).append( XMLHandler.addTagValue( "compression", ( content.fileCompression == null ) ? "None" : content.fileCompression ) ); retval.append( " </file>" ).append( Const.CR ); retval.append( " <filters>" ).append( Const.CR ); for ( int i = 0; i < filter.length; i++ ) { String filterString = filter[i].getFilterString(); byte[] filterBytes = new byte[] {}; String filterPrefix = ""; if ( filterString != null ) { filterBytes = filterString.getBytes(); filterPrefix = STRING_BASE64_PREFIX; } String filterEncoded = filterPrefix + new String( Base64.encodeBase64( filterBytes ) ); retval.append( " <filter>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_string", filterEncoded, false ) ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_position", filter[i].getFilterPosition(), false ) ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_is_last_line", filter[i].isFilterLastLine(), false ) ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_is_positive", filter[i].isFilterPositive(), false ) ); retval.append( " </filter>" ).append( Const.CR ); } retval.append( " </filters>" ).append( Const.CR ); retval.append( " <fields>" ).append( Const.CR ); for ( int i = 0; i < inputFields.length; i++ ) { BaseFileField field = inputFields[i]; retval.append( " <field>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "name", field.getName() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "type", field.getTypeDesc() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "format", field.getFormat() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "currency", field.getCurrencySymbol() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "decimal", field.getDecimalSymbol() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "group", field.getGroupSymbol() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nullif", field.getNullString() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "ifnull", field.getIfNullValue() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "position", field.getPosition() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "length", field.getLength() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "precision", field.getPrecision() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "trim_type", field.getTrimTypeCode() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "repeat", field.isRepeated() ) ); retval.append( " </field>" ).append( Const.CR ); } retval.append( " </fields>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "limit", content.rowLimit ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_ignored", errorHandling.errorIgnored ) ); retval.append( " " ).append( XMLHandler.addTagValue( "skip_bad_files", errorHandling.skipBadFiles ) ); retval.append( " " ).append( XMLHandler.addTagValue( "file_error_field", errorHandling.fileErrorField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "file_error_message_field", errorHandling.fileErrorMessageField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_line_skipped", errorLineSkipped ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_count_field", errorCountField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_fields_field", errorFieldsField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_text_field", errorTextField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "bad_line_files_destination_directory", errorHandling.warningFilesDestinationDirectory ) ); retval.append( " " ).append( XMLHandler.addTagValue( "bad_line_files_extension", errorHandling.warningFilesExtension ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_line_files_destination_directory", errorHandling.errorFilesDestinationDirectory ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_line_files_extension", errorHandling.errorFilesExtension ) ); retval.append( " " ).append( XMLHandler.addTagValue( "line_number_files_destination_directory", errorHandling.lineNumberFilesDestinationDirectory ) ); retval.append( " " ).append( XMLHandler.addTagValue( "line_number_files_extension", errorHandling.lineNumberFilesExtension ) ); retval.append( " " ).append( XMLHandler.addTagValue( "date_format_lenient", content.dateFormatLenient ) ); retval.append( " " ).append( XMLHandler.addTagValue( "date_format_locale", content.dateFormatLocale != null ? content.dateFormatLocale.toString() : null ) ); retval.append( " " ).append( XMLHandler.addTagValue( "shortFileFieldName", additionalOutputFields.shortFilenameField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "pathFieldName", additionalOutputFields.pathField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "hiddenFieldName", additionalOutputFields.hiddenField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "lastModificationTimeFieldName", additionalOutputFields.lastModificationField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "uriNameFieldName", additionalOutputFields.uriField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rootUriNameFieldName", additionalOutputFields.rootUriField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "extensionFieldName", additionalOutputFields.extensionField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "sizeFieldName", additionalOutputFields.sizeField ) ); return retval.toString(); }
TextFileInputMeta extends BaseFileInputMeta<BaseFileInputAdditionalField, BaseFileInputFiles, BaseFileField> implements StepMetaInterface, ResolvableResource { @Override public String getXML() { StringBuilder retval = new StringBuilder( 1500 ); retval.append( " " ).append( XMLHandler.addTagValue( "accept_filenames", inputFiles.acceptingFilenames ) ); retval.append( " " ).append( XMLHandler.addTagValue( "passing_through_fields", inputFiles.passingThruFields ) ); retval.append( " " ).append( XMLHandler.addTagValue( "accept_field", inputFiles.acceptingField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "accept_stepname", ( acceptingStep != null ? acceptingStep .getName() : "" ) ) ); retval.append( " " ).append( XMLHandler.addTagValue( "separator", content.separator ) ); retval.append( " " ).append( XMLHandler.addTagValue( "enclosure", content.enclosure ) ); retval.append( " " ).append( XMLHandler.addTagValue( "enclosure_breaks", content.breakInEnclosureAllowed ) ); retval.append( " " ).append( XMLHandler.addTagValue( "escapechar", content.escapeCharacter ) ); retval.append( " " ).append( XMLHandler.addTagValue( "header", content.header ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_headerlines", content.nrHeaderLines ) ); retval.append( " " ).append( XMLHandler.addTagValue( "footer", content.footer ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_footerlines", content.nrFooterLines ) ); retval.append( " " ).append( XMLHandler.addTagValue( "line_wrapped", content.lineWrapped ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_wraps", content.nrWraps ) ); retval.append( " " ).append( XMLHandler.addTagValue( "layout_paged", content.layoutPaged ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_lines_per_page", content.nrLinesPerPage ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_lines_doc_header", content.nrLinesDocHeader ) ); retval.append( " " ).append( XMLHandler.addTagValue( "noempty", content.noEmptyLines ) ); retval.append( " " ).append( XMLHandler.addTagValue( "include", content.includeFilename ) ); retval.append( " " ).append( XMLHandler.addTagValue( "include_field", content.filenameField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rownum", content.includeRowNumber ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rownumByFile", content.rowNumberByFile ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rownum_field", content.rowNumberField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "format", content.fileFormat ) ); retval.append( " " ).append( XMLHandler.addTagValue( "encoding", content.encoding ) ); retval.append( " " ).append( XMLHandler.addTagValue( "length", content.length ) ); retval.append( " " + XMLHandler.addTagValue( "add_to_result_filenames", inputFiles.isaddresult ) ); retval.append( " <file>" ).append( Const.CR ); inputFiles.normalizeAllocation( inputFiles.fileName.length ); for ( int i = 0; i < inputFiles.fileName.length; i++ ) { saveSource( retval, inputFiles.fileName[i] ); parentStepMeta.getParentTransMeta().getNamedClusterEmbedManager().registerUrl( inputFiles.fileName[i] ); retval.append( " " ).append( XMLHandler.addTagValue( "filemask", inputFiles.fileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "exclude_filemask", inputFiles.excludeFileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "file_required", inputFiles.fileRequired[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "include_subfolders", inputFiles.includeSubFolders[i] ) ); } retval.append( " " ).append( XMLHandler.addTagValue( "type", content.fileType ) ); retval.append( " " ).append( XMLHandler.addTagValue( "compression", ( content.fileCompression == null ) ? "None" : content.fileCompression ) ); retval.append( " </file>" ).append( Const.CR ); retval.append( " <filters>" ).append( Const.CR ); for ( int i = 0; i < filter.length; i++ ) { String filterString = filter[i].getFilterString(); byte[] filterBytes = new byte[] {}; String filterPrefix = ""; if ( filterString != null ) { filterBytes = filterString.getBytes(); filterPrefix = STRING_BASE64_PREFIX; } String filterEncoded = filterPrefix + new String( Base64.encodeBase64( filterBytes ) ); retval.append( " <filter>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_string", filterEncoded, false ) ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_position", filter[i].getFilterPosition(), false ) ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_is_last_line", filter[i].isFilterLastLine(), false ) ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_is_positive", filter[i].isFilterPositive(), false ) ); retval.append( " </filter>" ).append( Const.CR ); } retval.append( " </filters>" ).append( Const.CR ); retval.append( " <fields>" ).append( Const.CR ); for ( int i = 0; i < inputFields.length; i++ ) { BaseFileField field = inputFields[i]; retval.append( " <field>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "name", field.getName() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "type", field.getTypeDesc() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "format", field.getFormat() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "currency", field.getCurrencySymbol() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "decimal", field.getDecimalSymbol() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "group", field.getGroupSymbol() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nullif", field.getNullString() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "ifnull", field.getIfNullValue() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "position", field.getPosition() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "length", field.getLength() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "precision", field.getPrecision() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "trim_type", field.getTrimTypeCode() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "repeat", field.isRepeated() ) ); retval.append( " </field>" ).append( Const.CR ); } retval.append( " </fields>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "limit", content.rowLimit ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_ignored", errorHandling.errorIgnored ) ); retval.append( " " ).append( XMLHandler.addTagValue( "skip_bad_files", errorHandling.skipBadFiles ) ); retval.append( " " ).append( XMLHandler.addTagValue( "file_error_field", errorHandling.fileErrorField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "file_error_message_field", errorHandling.fileErrorMessageField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_line_skipped", errorLineSkipped ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_count_field", errorCountField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_fields_field", errorFieldsField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_text_field", errorTextField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "bad_line_files_destination_directory", errorHandling.warningFilesDestinationDirectory ) ); retval.append( " " ).append( XMLHandler.addTagValue( "bad_line_files_extension", errorHandling.warningFilesExtension ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_line_files_destination_directory", errorHandling.errorFilesDestinationDirectory ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_line_files_extension", errorHandling.errorFilesExtension ) ); retval.append( " " ).append( XMLHandler.addTagValue( "line_number_files_destination_directory", errorHandling.lineNumberFilesDestinationDirectory ) ); retval.append( " " ).append( XMLHandler.addTagValue( "line_number_files_extension", errorHandling.lineNumberFilesExtension ) ); retval.append( " " ).append( XMLHandler.addTagValue( "date_format_lenient", content.dateFormatLenient ) ); retval.append( " " ).append( XMLHandler.addTagValue( "date_format_locale", content.dateFormatLocale != null ? content.dateFormatLocale.toString() : null ) ); retval.append( " " ).append( XMLHandler.addTagValue( "shortFileFieldName", additionalOutputFields.shortFilenameField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "pathFieldName", additionalOutputFields.pathField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "hiddenFieldName", additionalOutputFields.hiddenField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "lastModificationTimeFieldName", additionalOutputFields.lastModificationField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "uriNameFieldName", additionalOutputFields.uriField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rootUriNameFieldName", additionalOutputFields.rootUriField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "extensionFieldName", additionalOutputFields.extensionField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "sizeFieldName", additionalOutputFields.sizeField ) ); return retval.toString(); } }
TextFileInputMeta extends BaseFileInputMeta<BaseFileInputAdditionalField, BaseFileInputFiles, BaseFileField> implements StepMetaInterface, ResolvableResource { @Override public String getXML() { StringBuilder retval = new StringBuilder( 1500 ); retval.append( " " ).append( XMLHandler.addTagValue( "accept_filenames", inputFiles.acceptingFilenames ) ); retval.append( " " ).append( XMLHandler.addTagValue( "passing_through_fields", inputFiles.passingThruFields ) ); retval.append( " " ).append( XMLHandler.addTagValue( "accept_field", inputFiles.acceptingField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "accept_stepname", ( acceptingStep != null ? acceptingStep .getName() : "" ) ) ); retval.append( " " ).append( XMLHandler.addTagValue( "separator", content.separator ) ); retval.append( " " ).append( XMLHandler.addTagValue( "enclosure", content.enclosure ) ); retval.append( " " ).append( XMLHandler.addTagValue( "enclosure_breaks", content.breakInEnclosureAllowed ) ); retval.append( " " ).append( XMLHandler.addTagValue( "escapechar", content.escapeCharacter ) ); retval.append( " " ).append( XMLHandler.addTagValue( "header", content.header ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_headerlines", content.nrHeaderLines ) ); retval.append( " " ).append( XMLHandler.addTagValue( "footer", content.footer ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_footerlines", content.nrFooterLines ) ); retval.append( " " ).append( XMLHandler.addTagValue( "line_wrapped", content.lineWrapped ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_wraps", content.nrWraps ) ); retval.append( " " ).append( XMLHandler.addTagValue( "layout_paged", content.layoutPaged ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_lines_per_page", content.nrLinesPerPage ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_lines_doc_header", content.nrLinesDocHeader ) ); retval.append( " " ).append( XMLHandler.addTagValue( "noempty", content.noEmptyLines ) ); retval.append( " " ).append( XMLHandler.addTagValue( "include", content.includeFilename ) ); retval.append( " " ).append( XMLHandler.addTagValue( "include_field", content.filenameField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rownum", content.includeRowNumber ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rownumByFile", content.rowNumberByFile ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rownum_field", content.rowNumberField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "format", content.fileFormat ) ); retval.append( " " ).append( XMLHandler.addTagValue( "encoding", content.encoding ) ); retval.append( " " ).append( XMLHandler.addTagValue( "length", content.length ) ); retval.append( " " + XMLHandler.addTagValue( "add_to_result_filenames", inputFiles.isaddresult ) ); retval.append( " <file>" ).append( Const.CR ); inputFiles.normalizeAllocation( inputFiles.fileName.length ); for ( int i = 0; i < inputFiles.fileName.length; i++ ) { saveSource( retval, inputFiles.fileName[i] ); parentStepMeta.getParentTransMeta().getNamedClusterEmbedManager().registerUrl( inputFiles.fileName[i] ); retval.append( " " ).append( XMLHandler.addTagValue( "filemask", inputFiles.fileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "exclude_filemask", inputFiles.excludeFileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "file_required", inputFiles.fileRequired[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "include_subfolders", inputFiles.includeSubFolders[i] ) ); } retval.append( " " ).append( XMLHandler.addTagValue( "type", content.fileType ) ); retval.append( " " ).append( XMLHandler.addTagValue( "compression", ( content.fileCompression == null ) ? "None" : content.fileCompression ) ); retval.append( " </file>" ).append( Const.CR ); retval.append( " <filters>" ).append( Const.CR ); for ( int i = 0; i < filter.length; i++ ) { String filterString = filter[i].getFilterString(); byte[] filterBytes = new byte[] {}; String filterPrefix = ""; if ( filterString != null ) { filterBytes = filterString.getBytes(); filterPrefix = STRING_BASE64_PREFIX; } String filterEncoded = filterPrefix + new String( Base64.encodeBase64( filterBytes ) ); retval.append( " <filter>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_string", filterEncoded, false ) ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_position", filter[i].getFilterPosition(), false ) ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_is_last_line", filter[i].isFilterLastLine(), false ) ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_is_positive", filter[i].isFilterPositive(), false ) ); retval.append( " </filter>" ).append( Const.CR ); } retval.append( " </filters>" ).append( Const.CR ); retval.append( " <fields>" ).append( Const.CR ); for ( int i = 0; i < inputFields.length; i++ ) { BaseFileField field = inputFields[i]; retval.append( " <field>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "name", field.getName() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "type", field.getTypeDesc() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "format", field.getFormat() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "currency", field.getCurrencySymbol() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "decimal", field.getDecimalSymbol() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "group", field.getGroupSymbol() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nullif", field.getNullString() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "ifnull", field.getIfNullValue() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "position", field.getPosition() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "length", field.getLength() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "precision", field.getPrecision() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "trim_type", field.getTrimTypeCode() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "repeat", field.isRepeated() ) ); retval.append( " </field>" ).append( Const.CR ); } retval.append( " </fields>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "limit", content.rowLimit ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_ignored", errorHandling.errorIgnored ) ); retval.append( " " ).append( XMLHandler.addTagValue( "skip_bad_files", errorHandling.skipBadFiles ) ); retval.append( " " ).append( XMLHandler.addTagValue( "file_error_field", errorHandling.fileErrorField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "file_error_message_field", errorHandling.fileErrorMessageField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_line_skipped", errorLineSkipped ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_count_field", errorCountField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_fields_field", errorFieldsField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_text_field", errorTextField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "bad_line_files_destination_directory", errorHandling.warningFilesDestinationDirectory ) ); retval.append( " " ).append( XMLHandler.addTagValue( "bad_line_files_extension", errorHandling.warningFilesExtension ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_line_files_destination_directory", errorHandling.errorFilesDestinationDirectory ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_line_files_extension", errorHandling.errorFilesExtension ) ); retval.append( " " ).append( XMLHandler.addTagValue( "line_number_files_destination_directory", errorHandling.lineNumberFilesDestinationDirectory ) ); retval.append( " " ).append( XMLHandler.addTagValue( "line_number_files_extension", errorHandling.lineNumberFilesExtension ) ); retval.append( " " ).append( XMLHandler.addTagValue( "date_format_lenient", content.dateFormatLenient ) ); retval.append( " " ).append( XMLHandler.addTagValue( "date_format_locale", content.dateFormatLocale != null ? content.dateFormatLocale.toString() : null ) ); retval.append( " " ).append( XMLHandler.addTagValue( "shortFileFieldName", additionalOutputFields.shortFilenameField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "pathFieldName", additionalOutputFields.pathField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "hiddenFieldName", additionalOutputFields.hiddenField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "lastModificationTimeFieldName", additionalOutputFields.lastModificationField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "uriNameFieldName", additionalOutputFields.uriField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rootUriNameFieldName", additionalOutputFields.rootUriField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "extensionFieldName", additionalOutputFields.extensionField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "sizeFieldName", additionalOutputFields.sizeField ) ); return retval.toString(); } TextFileInputMeta(); }
TextFileInputMeta extends BaseFileInputMeta<BaseFileInputAdditionalField, BaseFileInputFiles, BaseFileField> implements StepMetaInterface, ResolvableResource { @Override public String getXML() { StringBuilder retval = new StringBuilder( 1500 ); retval.append( " " ).append( XMLHandler.addTagValue( "accept_filenames", inputFiles.acceptingFilenames ) ); retval.append( " " ).append( XMLHandler.addTagValue( "passing_through_fields", inputFiles.passingThruFields ) ); retval.append( " " ).append( XMLHandler.addTagValue( "accept_field", inputFiles.acceptingField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "accept_stepname", ( acceptingStep != null ? acceptingStep .getName() : "" ) ) ); retval.append( " " ).append( XMLHandler.addTagValue( "separator", content.separator ) ); retval.append( " " ).append( XMLHandler.addTagValue( "enclosure", content.enclosure ) ); retval.append( " " ).append( XMLHandler.addTagValue( "enclosure_breaks", content.breakInEnclosureAllowed ) ); retval.append( " " ).append( XMLHandler.addTagValue( "escapechar", content.escapeCharacter ) ); retval.append( " " ).append( XMLHandler.addTagValue( "header", content.header ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_headerlines", content.nrHeaderLines ) ); retval.append( " " ).append( XMLHandler.addTagValue( "footer", content.footer ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_footerlines", content.nrFooterLines ) ); retval.append( " " ).append( XMLHandler.addTagValue( "line_wrapped", content.lineWrapped ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_wraps", content.nrWraps ) ); retval.append( " " ).append( XMLHandler.addTagValue( "layout_paged", content.layoutPaged ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_lines_per_page", content.nrLinesPerPage ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_lines_doc_header", content.nrLinesDocHeader ) ); retval.append( " " ).append( XMLHandler.addTagValue( "noempty", content.noEmptyLines ) ); retval.append( " " ).append( XMLHandler.addTagValue( "include", content.includeFilename ) ); retval.append( " " ).append( XMLHandler.addTagValue( "include_field", content.filenameField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rownum", content.includeRowNumber ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rownumByFile", content.rowNumberByFile ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rownum_field", content.rowNumberField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "format", content.fileFormat ) ); retval.append( " " ).append( XMLHandler.addTagValue( "encoding", content.encoding ) ); retval.append( " " ).append( XMLHandler.addTagValue( "length", content.length ) ); retval.append( " " + XMLHandler.addTagValue( "add_to_result_filenames", inputFiles.isaddresult ) ); retval.append( " <file>" ).append( Const.CR ); inputFiles.normalizeAllocation( inputFiles.fileName.length ); for ( int i = 0; i < inputFiles.fileName.length; i++ ) { saveSource( retval, inputFiles.fileName[i] ); parentStepMeta.getParentTransMeta().getNamedClusterEmbedManager().registerUrl( inputFiles.fileName[i] ); retval.append( " " ).append( XMLHandler.addTagValue( "filemask", inputFiles.fileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "exclude_filemask", inputFiles.excludeFileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "file_required", inputFiles.fileRequired[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "include_subfolders", inputFiles.includeSubFolders[i] ) ); } retval.append( " " ).append( XMLHandler.addTagValue( "type", content.fileType ) ); retval.append( " " ).append( XMLHandler.addTagValue( "compression", ( content.fileCompression == null ) ? "None" : content.fileCompression ) ); retval.append( " </file>" ).append( Const.CR ); retval.append( " <filters>" ).append( Const.CR ); for ( int i = 0; i < filter.length; i++ ) { String filterString = filter[i].getFilterString(); byte[] filterBytes = new byte[] {}; String filterPrefix = ""; if ( filterString != null ) { filterBytes = filterString.getBytes(); filterPrefix = STRING_BASE64_PREFIX; } String filterEncoded = filterPrefix + new String( Base64.encodeBase64( filterBytes ) ); retval.append( " <filter>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_string", filterEncoded, false ) ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_position", filter[i].getFilterPosition(), false ) ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_is_last_line", filter[i].isFilterLastLine(), false ) ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_is_positive", filter[i].isFilterPositive(), false ) ); retval.append( " </filter>" ).append( Const.CR ); } retval.append( " </filters>" ).append( Const.CR ); retval.append( " <fields>" ).append( Const.CR ); for ( int i = 0; i < inputFields.length; i++ ) { BaseFileField field = inputFields[i]; retval.append( " <field>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "name", field.getName() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "type", field.getTypeDesc() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "format", field.getFormat() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "currency", field.getCurrencySymbol() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "decimal", field.getDecimalSymbol() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "group", field.getGroupSymbol() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nullif", field.getNullString() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "ifnull", field.getIfNullValue() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "position", field.getPosition() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "length", field.getLength() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "precision", field.getPrecision() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "trim_type", field.getTrimTypeCode() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "repeat", field.isRepeated() ) ); retval.append( " </field>" ).append( Const.CR ); } retval.append( " </fields>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "limit", content.rowLimit ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_ignored", errorHandling.errorIgnored ) ); retval.append( " " ).append( XMLHandler.addTagValue( "skip_bad_files", errorHandling.skipBadFiles ) ); retval.append( " " ).append( XMLHandler.addTagValue( "file_error_field", errorHandling.fileErrorField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "file_error_message_field", errorHandling.fileErrorMessageField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_line_skipped", errorLineSkipped ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_count_field", errorCountField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_fields_field", errorFieldsField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_text_field", errorTextField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "bad_line_files_destination_directory", errorHandling.warningFilesDestinationDirectory ) ); retval.append( " " ).append( XMLHandler.addTagValue( "bad_line_files_extension", errorHandling.warningFilesExtension ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_line_files_destination_directory", errorHandling.errorFilesDestinationDirectory ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_line_files_extension", errorHandling.errorFilesExtension ) ); retval.append( " " ).append( XMLHandler.addTagValue( "line_number_files_destination_directory", errorHandling.lineNumberFilesDestinationDirectory ) ); retval.append( " " ).append( XMLHandler.addTagValue( "line_number_files_extension", errorHandling.lineNumberFilesExtension ) ); retval.append( " " ).append( XMLHandler.addTagValue( "date_format_lenient", content.dateFormatLenient ) ); retval.append( " " ).append( XMLHandler.addTagValue( "date_format_locale", content.dateFormatLocale != null ? content.dateFormatLocale.toString() : null ) ); retval.append( " " ).append( XMLHandler.addTagValue( "shortFileFieldName", additionalOutputFields.shortFilenameField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "pathFieldName", additionalOutputFields.pathField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "hiddenFieldName", additionalOutputFields.hiddenField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "lastModificationTimeFieldName", additionalOutputFields.lastModificationField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "uriNameFieldName", additionalOutputFields.uriField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rootUriNameFieldName", additionalOutputFields.rootUriField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "extensionFieldName", additionalOutputFields.extensionField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "sizeFieldName", additionalOutputFields.sizeField ) ); return retval.toString(); } TextFileInputMeta(); String[] getFileName(); void setFileName( String[] fileName ); TextFileFilter[] getFilter(); void setFilter( TextFileFilter[] filter ); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); @Override Object clone(); void allocate( int nrfiles, int nrfields, int nrfilters ); void allocateFiles( int nrFiles ); @Override void setDefault(); @Override void getFields( RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep,
      VariableSpace space, Repository repository, IMetaStore metaStore ); @Override @Deprecated void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
      VariableSpace space ); @Override String getXML(); String getLookupStepname(); @Override void searchInfoAndTargetSteps( List<StepMeta> steps ); String[] getInfoSteps(); @Override void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); @Override void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); @Override void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev,
      String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository,
      IMetaStore metaStore ); @Override StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta transMeta,
      Trans trans ); @Override StepDataInterface getStepData(); String getErrorCountField(); void setErrorCountField( String errorCountField ); String getErrorFieldsField(); void setErrorFieldsField( String errorFieldsField ); String getErrorTextField(); void setErrorTextField( String errorTextField ); String getRequiredFilesDesc( String tt ); boolean isErrorLineSkipped(); void setErrorLineSkipped( boolean errorLineSkipped ); void setAcceptingStep( StepMeta acceptingStep ); int getFileFormatTypeNr(); int getFileTypeNr(); @Override String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
      ResourceNamingInterface resourceNamingInterface, Repository repository, IMetaStore metaStore ); @Override boolean supportsErrorHandling(); @VisibleForTesting void setFileNameForTest( String[] fileName ); @Override String getEncoding(); String getLength(); void setLength( String length ); boolean isAcceptingFilenames(); String getAcceptingStepName(); StepMeta getAcceptingStep(); String getAcceptingField(); String[] getFilePaths( VariableSpace space ); FileInputList getTextFileList( VariableSpace space ); @Override void resolve(); }
TextFileInputMeta extends BaseFileInputMeta<BaseFileInputAdditionalField, BaseFileInputFiles, BaseFileField> implements StepMetaInterface, ResolvableResource { @Override public String getXML() { StringBuilder retval = new StringBuilder( 1500 ); retval.append( " " ).append( XMLHandler.addTagValue( "accept_filenames", inputFiles.acceptingFilenames ) ); retval.append( " " ).append( XMLHandler.addTagValue( "passing_through_fields", inputFiles.passingThruFields ) ); retval.append( " " ).append( XMLHandler.addTagValue( "accept_field", inputFiles.acceptingField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "accept_stepname", ( acceptingStep != null ? acceptingStep .getName() : "" ) ) ); retval.append( " " ).append( XMLHandler.addTagValue( "separator", content.separator ) ); retval.append( " " ).append( XMLHandler.addTagValue( "enclosure", content.enclosure ) ); retval.append( " " ).append( XMLHandler.addTagValue( "enclosure_breaks", content.breakInEnclosureAllowed ) ); retval.append( " " ).append( XMLHandler.addTagValue( "escapechar", content.escapeCharacter ) ); retval.append( " " ).append( XMLHandler.addTagValue( "header", content.header ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_headerlines", content.nrHeaderLines ) ); retval.append( " " ).append( XMLHandler.addTagValue( "footer", content.footer ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_footerlines", content.nrFooterLines ) ); retval.append( " " ).append( XMLHandler.addTagValue( "line_wrapped", content.lineWrapped ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_wraps", content.nrWraps ) ); retval.append( " " ).append( XMLHandler.addTagValue( "layout_paged", content.layoutPaged ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_lines_per_page", content.nrLinesPerPage ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nr_lines_doc_header", content.nrLinesDocHeader ) ); retval.append( " " ).append( XMLHandler.addTagValue( "noempty", content.noEmptyLines ) ); retval.append( " " ).append( XMLHandler.addTagValue( "include", content.includeFilename ) ); retval.append( " " ).append( XMLHandler.addTagValue( "include_field", content.filenameField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rownum", content.includeRowNumber ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rownumByFile", content.rowNumberByFile ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rownum_field", content.rowNumberField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "format", content.fileFormat ) ); retval.append( " " ).append( XMLHandler.addTagValue( "encoding", content.encoding ) ); retval.append( " " ).append( XMLHandler.addTagValue( "length", content.length ) ); retval.append( " " + XMLHandler.addTagValue( "add_to_result_filenames", inputFiles.isaddresult ) ); retval.append( " <file>" ).append( Const.CR ); inputFiles.normalizeAllocation( inputFiles.fileName.length ); for ( int i = 0; i < inputFiles.fileName.length; i++ ) { saveSource( retval, inputFiles.fileName[i] ); parentStepMeta.getParentTransMeta().getNamedClusterEmbedManager().registerUrl( inputFiles.fileName[i] ); retval.append( " " ).append( XMLHandler.addTagValue( "filemask", inputFiles.fileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "exclude_filemask", inputFiles.excludeFileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "file_required", inputFiles.fileRequired[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "include_subfolders", inputFiles.includeSubFolders[i] ) ); } retval.append( " " ).append( XMLHandler.addTagValue( "type", content.fileType ) ); retval.append( " " ).append( XMLHandler.addTagValue( "compression", ( content.fileCompression == null ) ? "None" : content.fileCompression ) ); retval.append( " </file>" ).append( Const.CR ); retval.append( " <filters>" ).append( Const.CR ); for ( int i = 0; i < filter.length; i++ ) { String filterString = filter[i].getFilterString(); byte[] filterBytes = new byte[] {}; String filterPrefix = ""; if ( filterString != null ) { filterBytes = filterString.getBytes(); filterPrefix = STRING_BASE64_PREFIX; } String filterEncoded = filterPrefix + new String( Base64.encodeBase64( filterBytes ) ); retval.append( " <filter>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_string", filterEncoded, false ) ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_position", filter[i].getFilterPosition(), false ) ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_is_last_line", filter[i].isFilterLastLine(), false ) ); retval.append( " " ).append( XMLHandler.addTagValue( "filter_is_positive", filter[i].isFilterPositive(), false ) ); retval.append( " </filter>" ).append( Const.CR ); } retval.append( " </filters>" ).append( Const.CR ); retval.append( " <fields>" ).append( Const.CR ); for ( int i = 0; i < inputFields.length; i++ ) { BaseFileField field = inputFields[i]; retval.append( " <field>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "name", field.getName() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "type", field.getTypeDesc() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "format", field.getFormat() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "currency", field.getCurrencySymbol() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "decimal", field.getDecimalSymbol() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "group", field.getGroupSymbol() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "nullif", field.getNullString() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "ifnull", field.getIfNullValue() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "position", field.getPosition() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "length", field.getLength() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "precision", field.getPrecision() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "trim_type", field.getTrimTypeCode() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "repeat", field.isRepeated() ) ); retval.append( " </field>" ).append( Const.CR ); } retval.append( " </fields>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "limit", content.rowLimit ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_ignored", errorHandling.errorIgnored ) ); retval.append( " " ).append( XMLHandler.addTagValue( "skip_bad_files", errorHandling.skipBadFiles ) ); retval.append( " " ).append( XMLHandler.addTagValue( "file_error_field", errorHandling.fileErrorField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "file_error_message_field", errorHandling.fileErrorMessageField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_line_skipped", errorLineSkipped ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_count_field", errorCountField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_fields_field", errorFieldsField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_text_field", errorTextField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "bad_line_files_destination_directory", errorHandling.warningFilesDestinationDirectory ) ); retval.append( " " ).append( XMLHandler.addTagValue( "bad_line_files_extension", errorHandling.warningFilesExtension ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_line_files_destination_directory", errorHandling.errorFilesDestinationDirectory ) ); retval.append( " " ).append( XMLHandler.addTagValue( "error_line_files_extension", errorHandling.errorFilesExtension ) ); retval.append( " " ).append( XMLHandler.addTagValue( "line_number_files_destination_directory", errorHandling.lineNumberFilesDestinationDirectory ) ); retval.append( " " ).append( XMLHandler.addTagValue( "line_number_files_extension", errorHandling.lineNumberFilesExtension ) ); retval.append( " " ).append( XMLHandler.addTagValue( "date_format_lenient", content.dateFormatLenient ) ); retval.append( " " ).append( XMLHandler.addTagValue( "date_format_locale", content.dateFormatLocale != null ? content.dateFormatLocale.toString() : null ) ); retval.append( " " ).append( XMLHandler.addTagValue( "shortFileFieldName", additionalOutputFields.shortFilenameField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "pathFieldName", additionalOutputFields.pathField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "hiddenFieldName", additionalOutputFields.hiddenField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "lastModificationTimeFieldName", additionalOutputFields.lastModificationField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "uriNameFieldName", additionalOutputFields.uriField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rootUriNameFieldName", additionalOutputFields.rootUriField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "extensionFieldName", additionalOutputFields.extensionField ) ); retval.append( " " ).append( XMLHandler.addTagValue( "sizeFieldName", additionalOutputFields.sizeField ) ); return retval.toString(); } TextFileInputMeta(); String[] getFileName(); void setFileName( String[] fileName ); TextFileFilter[] getFilter(); void setFilter( TextFileFilter[] filter ); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); @Override Object clone(); void allocate( int nrfiles, int nrfields, int nrfilters ); void allocateFiles( int nrFiles ); @Override void setDefault(); @Override void getFields( RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep,
      VariableSpace space, Repository repository, IMetaStore metaStore ); @Override @Deprecated void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
      VariableSpace space ); @Override String getXML(); String getLookupStepname(); @Override void searchInfoAndTargetSteps( List<StepMeta> steps ); String[] getInfoSteps(); @Override void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); @Override void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); @Override void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev,
      String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository,
      IMetaStore metaStore ); @Override StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta transMeta,
      Trans trans ); @Override StepDataInterface getStepData(); String getErrorCountField(); void setErrorCountField( String errorCountField ); String getErrorFieldsField(); void setErrorFieldsField( String errorFieldsField ); String getErrorTextField(); void setErrorTextField( String errorTextField ); String getRequiredFilesDesc( String tt ); boolean isErrorLineSkipped(); void setErrorLineSkipped( boolean errorLineSkipped ); void setAcceptingStep( StepMeta acceptingStep ); int getFileFormatTypeNr(); int getFileTypeNr(); @Override String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
      ResourceNamingInterface resourceNamingInterface, Repository repository, IMetaStore metaStore ); @Override boolean supportsErrorHandling(); @VisibleForTesting void setFileNameForTest( String[] fileName ); @Override String getEncoding(); String getLength(); void setLength( String length ); boolean isAcceptingFilenames(); String getAcceptingStepName(); StepMeta getAcceptingStep(); String getAcceptingField(); String[] getFilePaths( VariableSpace space ); FileInputList getTextFileList( VariableSpace space ); @Override void resolve(); static final int FILE_FORMAT_DOS; static final int FILE_FORMAT_UNIX; static final int FILE_FORMAT_MIXED; static final int FILE_TYPE_CSV; static final int FILE_TYPE_FIXED; @InjectionDeep
  public Content content; @Injection( name = "ERROR_COUNT_FIELD" )
  public String errorCountField; @Injection( name = "ERROR_FIELDS_FIELD" )
  public String errorFieldsField; @Injection( name = "ERROR_TEXT_FIELD" )
  public String errorTextField; @Injection( name = "ERROR_LINES_SKIPPED" )
  public boolean errorLineSkipped; }