Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.3k views
in Java FTP by (200 points)
Good Morning,

How do I do to obtain more details from FTPFile.lastModified()? It seems like I can't get more precision than minutes and I would like to get this information to the seconds.

The reason I want to do this is that we have a FTP server on DMZ where customers would drop there documents. One of our app server would grab these files (using edt api) to process them. However, I don't want my app server to download files customers didn't completes their upload. Thus, if currentTime-lastModified is greater than a given value, (let's say 30 seconds), we can presume the file is completely uploaded by customer and is ready to be taken by my app server. There may be other way to do that... If you know, please, let me know.

Thanks

Hugues Tremblay

4 Answers

0 votes
by (200 points)
Great!

These two methods doesn't return the same values even if documentation for
modtime says
Returns:
modification time of file as a date

while

documentation for
lastmodified says:
Returns:
Returns the lastModified date.

Sound pretty much the same for me....don't you think?

Thanks

Hugues Tremblay
0 votes
by (162k points)
These methods are a bit different in how they are implemented.

modtime uses an FTP command called MDTM (not supported by all FTP servers) which generally goes down to seconds.

FTPFile.lastModified is produced by parsing a file listing provided by the server, and these don't provide seconds.
0 votes
by (200 points)
Thank you fo your answer.

I see that you work with edt. Will you describe this in the documentation in a near future?

Thanks

Hugues Tremblay
0 votes
by (162k points)
The documentation has been updated to point this out, and will appear in the next release.

Categories

...