Dimitri Kotlovsky created CAMEL-13931:
-----------------------------------------

             Summary: GenericFileProducer only auto-creates directory for temp 
if parent folder is used
                 Key: CAMEL-13931
                 URL: https://issues.apache.org/jira/browse/CAMEL-13931
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 3.0.0.M4, 2.24.1, 2.22.5, 2.23.3
            Reporter: Dimitri Kotlovsky


Hi,

I face a requirement to place temp files in a folder at the same hierarchy as 
the output folder like this:
 * {{target/data/output/claus.txt}}
 * {{target/data/temp/claus.tmp}}

Using a simple route definition like:
{code:java}
from("direct:a").to("file://target/data/output/?tempFileName=../temp/${file:name.noext}.tmp"){code}
 

If the destination folders do not exist, the GenericFileProducer should 
auto-create them. However, it only does this for the tempFileName path, not for 
both, i.e. ../temp is generated but ../output isn't.

 

A very easy way to reproduce this is to use the 'parentFileUrl' instead of the 
'fileUrl' in the createRouteBuilder method of FileProduceTempFileNameTest.java 
(https://github.com/apache/camel/blob/master/core/camel-core/src/test/java/org/apache/camel/component/file/FileProduceTempFileNameTest.java).



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to