Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.22.2
-
Patch Available
-
Unknown
-
Patch
Description
Dear all,
We are using Camel's File2 endpoint to deliver reports to a Windows network share. The used URI is (here in a properties file):
# File URI equivalent of \\FILESERVER.mycompany.local\Public\reports
report.delivery.to=file:////FILESERVER.mycompany.local/Public/reports?keepLastModified=true&tempPrefix=tmp_
This results in an exception, see the stack trace (attached).
I debugged and traced the issue back to:
org.apache.camel.component.file.GenericFileProducer#createTempFileName
which is using
org.apache.camel.util.FileUtil#compactPath(java.lang.String, java.lang.String)
This method only preserves the first slash/backslash at the start. For UNC paths on Windows however, 2 backslashes are needed.
I prepared a patch for:
- org.apache.camel.util.FileUtil
- org.apache.camel.util.FileUtilTest
which remedies the issue on Windows.
I would appreciate if you could check the patch, and integrate it to 2.x and 3.x branches if it is ok.
Thank you.
Kind regards,
Clemens