Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.1k views
in Java FTP by (120 points)
I'm running EDT FTP for Java 1.3.2. Every now and then I would get the following exception during an upload of a file with a unique name. Today it happened about 17 times in a row, until I restarted the application. The values after the "0062" directory is different for each time the exception is thrown.
com.enterprisedt.net.ftp.FTPException: /usr/users/vftp/tdngine27/data/20070515/A000/0062/20070515A00000624470: File exists.
        at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(Unknown Source)
        at com.enterprisedt.net.ftp.FTPClient.A(Unknown Source)
        at com.enterprisedt.net.ftp.FTPClient.A(Unknown Source)
        at com.enterprisedt.net.ftp.FTPClient.put(Unknown Source)
        at com.enterprisedt.net.ftp.FTPClient.put(Unknown Source)
        at com.enterprisedt.net.ftp.FTPClient.put(Unknown Source)


Could you, please, tell me what this exception means, when and why is it generated, and what I could do to avoid it.
Thanks,
Elana

1 Answer

0 votes
by (51.6k points)
This error is coming from the server, which (obviously?) is reporting that a file with that name already exists and therefore won't overwrite it. I suggest that you test whether or not the file exists before trying to write it. You can use the FTPClient.exists(String) method to do this.

If you are relying on the server to generate the file-name (by passing null in as the remoteFile argument when calling put()), then this points to a bug on the server. Can you check the server logs?

- Hans (EnterpriseDT)

Categories

...