|
On further review – you're right - or mostly so!
I checked a few popular FTP servers (including several Apache mirrors) and all Then I looked back at earlier versions of our code. Prior to the introduction of The new code "improved" things by delegating to java.util.Date's "simple" Your suggestion probably works best of all, but I'm still a little bothered by Perhaps Daniel might like to chime in on how he remembers this? I think sometimes the year would be missing for
6 months ago < date < 12 months ago but I can't be sure. I dug up an archive of the original oroinc.com CVS repository and looked through the log comments but couldn't come up with anything definitive. The looser test may have simply been defensive programming. 1997 was oh so long ago. OK - we're in uncharted waters here and I am not entirely sure what is the right
thing to do. Daniel Savarese, the original author of this code base does not remember the The current implementation is more "accurate" but at the cost of being I could for example, without too much trouble, recode this so that any server Mr. Ishigami: I need more information from you. 2) Please indicate whether you have any information other than observation that Parenthetically, I'll note that this whole business is a powerful argument in (In reply to comment #4)
> Parenthetically, I'll note that this whole business is a powerful argument in Out of curiosity, I took a look at some of Debian's FTP mirrors and it appears (In reply to comment #4)
>> The current implementation is more "accurate" but at the cost of being > completely intolerant of "slop". > > I could for example, without too much trouble, recode this so that any server > timestamps that appear to be more than one day in the future be considered last > year. I have had a go at testing this idea. It breaks our JUnit tests, but that's > 1) Can you tell me your exact use case? Are you having this problem because
> a) the clocks are out of synch and you could fix the problem > b) the clocks are out of synch but you can't do anything about it beacuse the > server is out of your control? > c) the server is in a different time zone from the client which you could handle > by using FTPClientConfig? b) In my case, two servers are running on same time zone and the clocks are out of I use the Commons Net for the purpose of B2B. In case of intranet, several This problem is reporductable as following for my case: Server A=14:00 Server B=14:05 I tried to quick-fix this problem to described code. But, I thought that this is > 2) Please indicate whether you have any information other than observation Six month came from my observation. I do not have further information. Solaris 9 FTP Server rollover six months. I think that the problem is how long local server can accept when timestamp of My suggestion is six months becase of observation above. (In reply to comment #6)
> having trouble deciding whether it's a good thing or a bad thing to allow for > "slop", maybe that's a sign that we need a "slop-mode" option in FTPClientConfig > (probably named differently)? Perhaps something similar to how > SimpleDateFormat.isLenient() exists because one size does not fit all? That sounds like a good compromise. Every time we've tried to impose A new method, FTPClientConfig.setLenientFutureDates() allows a "slop" factor of
one day, which sounds like it will fit with your use case. You'll have to get source from CVS or use nightly builds until this is released. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
How do you KNOW "the date format is switched after six months"? Is that the way
your server does it? The problem with FTP is that there is NO standard on these
matters. On the other hand if you DO have some authoritative statement of what
you're saying, I'd love to see it. Please send it.
Or, if timezone differences are the reason for your discrepancy, 1.4.0 offers a
way to handle it. It's in the documentation. See FTPClientConfig.