public final class MLSDParser extends java.lang.Object implements FtpFileParser
Constructor and Description |
---|
MLSDParser() |
Modifier and Type | Method and Description |
---|---|
java.util.Date |
getDateTime(FtpFile file)
Gets the date and time for an FtpFile entry sourced from an MLSD 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)
Method for parsing a directory listing returned by FTP server.
|
FtpFile |
parse(java.lang.String line)
Parses file description line.
|
public FtpFile parse(java.lang.String line)
line
- line to parsepublic java.util.Enumeration parse(java.io.BufferedReader in) throws java.io.IOException
FtpFileParser
parse
in interface FtpFileParser
in
- a BufferedReader passed in by Ftp class when invoking Ftp#getDirListing methodEnumeration
of FtpFile
java.io.IOException
- if an I/O or FTP related error occursFtpFileParser.parse(java.io.BufferedReader)
public java.util.Date getFileDate(java.lang.String date)
getFileDate
in interface FtpFileParser
date
- The string will be parsedjava.text.ParseException
- if an error ocurrspublic 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
Copyright © JSCAPE LLC. 1999-2023. All Rights Reserved