Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.10.1
-
None
-
Windows
Description
When I try to copy a file using ScpClient.upload() to a remote machine using an absolute path that begins with a drive letter, the copy operation will fail:
Exception in thread "main" java.io.IOException: Received nack: Can not write to /C:/Workspace/SSHTest/bin/C:/DOKUME~1/AUTOBU~1/LOKALE~1/Temp/testfile.txt
(the current working directory was C:\Workspace\SSHTest\bin)
When I use an absolute path that does not begin with a drive letter (e.g. "\DOKUME~1\AUTOBU~1\LOKALE~1\Temp\testfile.txt) the copy operation works.
It seems that the windows client does not recognize paths beginning with a drive letter as absolute, so it assums a relative path and eppends it to the current directory (C:\Workspace\SSHTest\bin in this case).
Below a piece of testcode:
private ScpClient m_scp;
private String srcFile = "testfile.txt";
private String dstFile = "C:\\DOKUME~1\\AUTOBU~1\\LOKALE~1\\Temp
testfile.txt";
m_scp = m_session.createScpClient();
m_scp.upload(srcFile, dstFile);