Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Not A Bug
-
3.5.0, 3.6.0
-
None
-
None
-
Unknown
Description
When using either parameter tempFileName or tempPrefix with a relative path, the component will not create the final target directory and moving/renaming the file from the temp location will fail.
Both tests below will fail when placing them in FtpProducerTempPrefixTest
@Test public void testWriteUsingRelativeTempPrefix() throws Exception { sendFile("ftp://admin@localhost:" + getPort() + "/upload/user/claus?binary=false&password=admin" + "&tempPrefix=../tmp/tmp_", "Hello World", "claus.txt"); Thread.sleep(500); File file = new File(FTP_ROOT_DIR + "/upload/user/claus/claus.txt"); assertTrue(file.exists(), "The uploaded file should exists"); assertEquals("Hello World", IOConverter.toString(file, null)); } @Test public void testWriteUsingRelativeTempFileName() throws Exception { sendFile("ftp://admin@localhost:" + getPort() + "/upload/user/claus?binary=false&password=admin" + "&tempFileName=../tmp/${file:name.noext}.tmp", "Hello World", "claus.txt"); Thread.sleep(500); File file = new File(FTP_ROOT_DIR + "/upload/user/claus/claus.txt"); assertTrue(file.exists(), "The uploaded file should exists"); assertEquals("Hello World", IOConverter.toString(file, null)); }