Discuss (FTP) and (SFTP, FTPS and SCP), our Java file transfer clients.

File locked after exception.

no avatar
User

Guest

File locked after exception.

by Guest » Tue Mar 08, 2005 10:23 am

FTPClient locks file after "put" throws exception. The lock is still there even after "quit" method is called.

FTPClient ftp_client = null;
try{
ftp_client = getFTPClient();
ftp_client.chdir(workingRemoteFilePath);
ftp_client.put( workingLocalFile.getPath(), workingRemoteFileName );
ftpUploadSuccessful = true;
processSession.addAudit(this, "File " + workingLocalFile + " uploaded to " +
workingRemoteFilePath + "\\" + workingRemoteFileName );
}catch(Exception e){
processSession.addErrorAudit(this, "Exception uploading file " + workingLocalFile + " to " +
workingRemoteFilePath + "\\" + workingRemoteFileName, e );
throw e;
}finally{
/* quite to release local file */

if (ftp_client != null){
if ( LOG.isDebugEnabled() ) LOG.debug("Quitting FTP Client");
try{ftp_client.quit();}
catch(Exception e){LOG.error("Exception quitting FTPClient", e);}
}
System.out.println("LLLLLLLLLLLLLLLLLLLLLLLLLLL " +
workingLocalFile.delete() );
}

output:

[java] DEBUG [main] process.FTPProcessComponent (?:?) - Quitting FTP Client
[java] LLLLLLLLLLLLLLLLLLLLLLLLLLL false
no avatar
User

guyulmaz

FTPClient locks the local file after "put"

by guyulmaz » Thu Jun 09, 2005 3:11 am

I have a similar problem even the put opertation is successful I cant delete the local file. Why FTPClient still holds the file's lock?[/quote]
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: FTPClient locks the local file after "put"

by support2 » Thu Jun 09, 2005 3:58 am

no avatar
User

guyulmaz

Re: FTPClient locks the local file after "put"

by guyulmaz » Thu Jun 09, 2005 4:11 am

[quote="support2"]What version are you using?
1.5.0
same with 1.4.9 and 1.4.8
no avatar
User

Guest

Re: FTPClient locks the local file after "put"

by Guest » Thu Jun 09, 2005 6:22 pm

no avatar
User

guyulmaz

Re: FTPClient locks the local file after "put"

by guyulmaz » Thu Jun 09, 2005 6:23 pm

no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: FTPClient locks the local file after "put"

by support2 » Thu Jun 09, 2005 7:17 pm


Who is online

Users browsing this forum: No registered users and 13 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign