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 Mon, 27 Sep 2004 06:51:27 GMT
Steve Cohen schrieb:

>Where I was sort of heading was a combination of these, since I'm still not 
>sure that server locale implies a particular date format.
>
You might be right, though i think the combination of server-type/locale 
will be sufficient for a reproducible result.
At least as long as the ftp-server might not allow the user to define a 
custom dateformat.
But you are right if you mean the automatic detection could lead to a 
complicated task - i think it is possible that some ftp-server changed 
the date-format during their versions.
Maybe - if it comes to the automatic detection - we might see we have to 
use the version-part of the SYST command too.

>I don't think so, and I'm not sure that anything 
>forces an ftp server to format its listings in the locale-specific way.
>  
>
I think a ftp-server might use a "posix" format or the servers locale 
format - other strategies might make not much sense.

But again - it might make not much sense to spend much effort in this 
now, what if we simply prepare the locale/date structure to be ready for 
such a thing - so we do not have to refactor the api any time later.
For now a simply "ident" might be enough - later we could use it for the 
server-type (and/or the server-version from SYST)

>public static FTPDateFormat FTPDateFormatFactory.createFTPDateFormat(
>	Locale locale, 
>	SimpleDateFormat newerThanOneYear, 
>	SimpleDateFormat olderThanOneYear)
>  
>
public static FTPDateFormat FTPDateFormatFactory.createFTPDateFormat(

	*String ident,*

	Locale locale, 
	SimpleDateFormat newerThanOneYear, 
	SimpleDateFormat olderThanOneYear)

>public static FTPDateFormat FTPDateFormatFactory.createFTPDateFormat(
>	Locale locale)
>  
>
public static FTPDateFormat FTPDateFormatFactory.createFTPDateFormat(

	*String ident,*

	Locale locale)


What if we first try to collect some directory listings.
Maybe we might see only the name of the month changes - then we do not 
need to build all this, but simply extend the parsing of the month name 
to a multi-language like style.
The positive effekt could be we do not need to bother the user with this.

---
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