public class UnixParser extends java.lang.Object implements FtpFileParser
-rw-r--r-- 1 vglass vglass 3651 Feb 2 2002 .screenrc drwxr-xr-x 3 vglass vglass 4096 Jul 23 17:42 Archive -rw-r--r-- 1 vglass vglass 1096 Jul 23 13:35 GZipTest1.class -rw-r--r-- 1 vglass vglass 733 Jul 23 13:35 GZipTest1.java *
Constructor and Description |
---|
UnixParser() |
Modifier and Type | Method and Description |
---|---|
java.util.Date |
getDateTime(FtpFile file)
Gets the date and time for an FtpFile entry sourced from a UNIX directory
listing.
|
java.util.Date |
getDateTime(FtpFile file,
java.util.TimeZone zone,
java.util.Locale locale)
Gets the date and time for an FtpFile entry sourced from a UNIX directory
listing.
|
java.util.Date |
getFileDate(java.lang.String date)
Parses a string which contains a date and returns a date object
|
java.util.Enumeration |
parse(java.io.BufferedReader in)
Parses directory listing.
|
FtpFile |
parseLine(java.lang.String line) |
void |
setLocale(java.util.Locale locale)
Sets locale used for parsing date.
|
public java.util.Enumeration parse(java.io.BufferedReader in) throws java.io.IOException
parse
in interface FtpFileParser
in
- the BufferedReader passed in by Ftp class when invoking
Ftp#getDirListing method.java.io.IOException
- if an I/O or FTP related error occursFtpFile
,
Ftp.getDirListing(java.lang.String)
public java.util.Date getDateTime(FtpFile file, java.util.TimeZone zone, java.util.Locale locale) throws java.text.ParseException
file
- the FtpFilezone
- the TimeZone to use when calculating time. Your default
timezone is used if not provided.locale
- the Locale to use when parsing date. Locale.US is used if not
provided.java.text.ParseException
- if an error occurs while parsing entryTimeZone
,
Locale
,
FtpFile
public java.util.Date getDateTime(FtpFile file) throws java.text.ParseException
getDateTime
in interface FtpFileParser
file
- the FtpFilejava.text.ParseException
- if an error occurs while parsing entryFtpFile
public FtpFile parseLine(java.lang.String line)
public java.util.Date getFileDate(java.lang.String date) throws java.text.ParseException
getFileDate
in interface FtpFileParser
date
- The string will be parsedjava.text.ParseException
- if an error ocurrspublic void setLocale(java.util.Locale locale)
locale
- the localeCopyright © JSCAPE LLC. 1999-2021. All Rights Reserved