I'm working on getting this log file together for you but I think I found something that can help without it. I nailed down when the problem happens:
If you just transfer a file to another location, the problem does NOT exist.
However, if you create a directory, ftp.mkdir(String), then transfer a file to that newly created directory, ftp.put(String, String), then the problem pops up -- if you try to delete or move the file, Windows complains because the file is in use.
I was able to duplicate this test 100% of the times. Here is the sample code below. Let me know if you still need me to send the logs:
public class testing
{
public static void main(String[] args)
{
String sLocalFile = "C:\\image.jpg";
// In this example, the path "/cygdrive/d/Me" Exists.... newfolder is the new directory
String sRemoteFile = "/cygdrive/d/Me/newfolder/image.jpg";
String sRemoteFoldername = "/cygdrive/d/Me/newfolder";
String sServer = "localhost";
String sUserName = "ausername";
String sPassword = "apassword";
SSHFTPClient ftp = new SSHFTPClient();
try
{
// set remote host
ftp.setRemoteHost( sServer);
System.out.println( " Setting user-name and password");
ftp.setAuthentication( sUserName, sPassword);
System.out.println( " Turning off server validation");
ftp.getValidator().setHostValidationEnabled( false);
// connect to the server
System.out.println( " Connecting to server");
ftp.connect();
System.out.println( " Connected");
ftp.mkdir( sRemoteFoldername);
System.out.println( "Created Folder: " + sRemoteFoldername);
ftp.put( sLocalFile, sRemoteFile);
System.out.println( "Put file: " + sLocalFile + " to " + sRemoteFile);
ftp.quit();
}
catch(FTPException ex)
{
System.out.println( "FTPError Connecting. " + ex.getMessage());
}
catch(IOException ex)
{
System.out.println( "IOError Connecting. " + ex.getMessage());
}
}
}
By the way, the new directory you create is not in use, just all of the files or subdirectories you create under it are....