commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject Re: [NET] Designing a Date Format-aware FTP Entry Parser
Date Sun, 26 Sep 2004 06:51:55 GMT
Steve Cohen wrote:

>and delegate the task of parsing it to a pair of  
>SimpleDateFormat objects (one for less than 1 year old and the other for one 
>year old or older), each constructed on the basis of a format string and a 
>locale.
>
Sounds good at all, just one additional question: How should the user 
pass in these date parsers?

1) explicitly set the date parser per connections
But this might work against the idea behind the default file entry parser.
The default file entry parser uses some "magic" to decide the real 
parser and hide the pain about the different styles from the user.
Depending on the result the possible date formats could be known too 
(except for the locale for sure).
If the user needs to set a real date parser implementation he always has 
to take the result of the DefaultFileEntryParser into account.

This brings me to
2) only set a java.util.Locale per connection
and pick the needet date parser - in combination with the result of SYST 
- out of a date parser pool.

For sure - it should be possible to do 1) but this should not be the 
preferred way.

---
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message