Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-16101

doneFileName=${file:name} not working for file component

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Bug
    • 3.7.1
    • None
    • came-core
    • None
    • Moderate
    • Hide
      https://camel.apache.org/components/latest/file-component.html#_using_done_files:

      However it is more common to have one done file per target file. This means there is a 1:1 correlation. To do this you must use dynamic placeholders in the doneFileName option. Currently Camel supports the following two dynamic tokens: file:name and file:name.noext which must be enclosed in ${ }. The consumer only supports the static part of the done file name as either prefix or suffix (not both).
      Show
      https://camel.apache.org/components/latest/file-component.html#_using_done_files: However it is more common to have one done file per target file. This means there is a 1:1 correlation. To do this you must use dynamic placeholders in the doneFileName option. Currently Camel supports the following two dynamic tokens: file:name and file:name.noext which must be enclosed in ${ }. The consumer only supports the static part of the done file name as either prefix or suffix (not both).

    Description

      When using the "doneFileName=${file:name}.done" option for the file component, camel throws the following error:

       

      Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: file:///Data/contactdb/upload/xx2cin&charset=utf8&delete=true&doneFileName=$%7Bfile:name%7D.done due to: Invalid directory: /Data/contactdb/upload/xx2cin&charset=utf8&delete=true&doneFileName=${file:name}.done. Dynamic expressions with ${ } placeholders is not allowed. Use the fileName option to set the dynamic expression.Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: file:///Data/contactdb/upload/xx2cin&charset=utf8&delete=true&doneFileName=$%7Bfile:name%7D.done due to: Invalid directory: /Data/contactdb/upload/xx2cin&charset=utf8&delete=true&doneFileName=${file:name}.done. Dynamic expressions with ${ } placeholders is not allowed. Use the fileName option to set the dynamic expression. at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:913) at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:794) at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:177) at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:93) at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:73) ... 13 moreCaused by: java.lang.IllegalArgumentException: Invalid directory: /Data/contactdb/upload/xx2cin&charset=utf8&delete=true&doneFileName=${file:name}.done. Dynamic expressions with ${ } placeholders is not allowed. Use the fileName option to set the dynamic expression. at org.apache.camel.component.file.FileComponent.buildFileEndpoint(FileComponent.java:55) at org.apache.camel.component.file.GenericFileComponent.createEndpoint(GenericFileComponent.java:58) at org.apache.camel.component.file.GenericFileComponent.createEndpoint(GenericFileComponent.java:38) at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:170) at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:879) ... 18 more

      Attachments

        Activity

          People

            Unassigned Unassigned
            egelke Bryan Brouckaert
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: