Frage

I read in the FTPClient API the following statement:

boolean storeUniqueFile(InputStream local)
Stores a file on the server using a unique name assigned by the server and taking input from the given InputStream.

Source: http://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/ftp/FTPClient.html#storeUniqueFile(java.io.InputStream)

How do I know the unique name or path the server assigned for the file? Has anybody used this API before?

War es hilfreich?

Lösung

Finally I didn't find any way to get to know the assigned file name, because even it is not in the FTP server's response. My FTP server (vsftpd 3.0.2 under Ubuntu) for storeUniqueFile command simply answers

226 Transfer complete.

and I don't have any more information. The file is created usually with .1, .2, etc. extension. If I was sure that nobody uses the ftp server concurrently, I could run a listFiles() before and after and simply make a diff. That is all :-(

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top