pfx-validator:csv
Validates a CSV file or stream whether it is a valid file. It is possible to validate against a schema.
Properties
Option | Type | Default | Description |
---|---|---|---|
| Boolean | false | Sets |
| string |  | Sets |
| string |  | Sets |
| Boolean | false | If set and the input contains validation errors, the errors and warnings will be printed to the logger and will not set exception on the exchange. |
| Boolean | false | If set to true, the component will only read the number of lines and line separator. There will be no validations performed. |
| string |  | If set, the component will look up the schema definition from the header If not set or schemaName is not found, no validation will be performed (equals to |
Examples
Using preValidator, no exception on failure
<route>
              <from uri="direct:empty_line2"/>
              <to uri="pfx-validator:csv?regularExpression=RAW(.+)&onlyPrintWarning=true"/>
              <to uri="mock:empty_line2"/>
</route>
Â
Using validationSchema defined in header
<routes xmlns="http://camel.apache.org/schema/spring">
            <route>
                <from uri="direct:start"/>
                <setHeader name="PfxValidatorSchema">
                    <constant>{}</constant>
                </setHeader>
                <to uri="pfx-validator:csv?validationSchemaName=mySchema"/>
                <to uri="mock:end"/>
            </route>
        </routes>
Â
Example of validation schema
{"name":"pm-dataload","title":"pm-dataload","description":"pm-dataload","options":{"charset":"UTF-8","delimiter":"|","escapeChar":"\\\\","quoteChar":"\\"","failFast":false,"rowCountOnly":false,"ignoreEmptyLines":true},"fields":[]}
IntegrationManager version 5.8.0