public class MLSxEntryParser extends FTPFileEntryParserImpl
MSLT and MLSD replies. See RFC 3659.
The format is as follows:
entry = [ facts ] SP path
facts = 1*( fact ";" )
fact = factname "=" value
factname = "Size" / "Modify" / "Create" /
"Type" / "Unique" / "Perm" /
"Lang" / "Media-Type" / "CharSet" /
os-depend-fact / local-fact
os-depend-fact = {IANA assigned OS name} "." token
local-fact = "X." token
value = *SCHAR
Sample os-depend-fact:
UNIX.group=0;UNIX.mode=0755;UNIX.owner=0;
A single control response entry (MLST) is returned with a leading space; multiple (data) entries are returned without any leading spaces. The parser requires that the leading space from the MLST entry is removed. MLSD entries can begin with a single space if there are no facts.
| Modifier and Type | Method and Description |
|---|---|
static MLSxEntryParser |
getInstance()
Gets the singleton instance.
|
static FTPFile |
parseEntry(String entry)
Parses a line of an FTP server file listing and converts it into a usable format in the form of an
FTPFile instance. |
FTPFile |
parseFTPEntry(String entry)
Parses a line of an FTP server file listing and converts it into a usable format in the form of an
FTPFile instance. |
static Calendar |
parseGMTdateTime(String timestamp)
Parse a GMT time stamp of the form yyyyMMDDHHMMSS[.sss]
|
static java.time.Instant |
parseGmtInstant(String timestamp)
Parse a GMT time stamp of the form yyyyMMDDHHMMSS[.sss]
|
preParse, readNextEntrypublic static MLSxEntryParser getInstance()
public static FTPFile parseEntry(String entry)
FTPFile instance. If the file listing
line doesn't describe a file, null should be returned, otherwise a FTPFile instance representing the files in the directory
is returned.entry - A line of text from the file listingpublic FTPFile parseFTPEntry(String entry)
FTPFileEntryParserFTPFile instance. If the file listing
line doesn't describe a file, null should be returned, otherwise a FTPFile instance representing the files in the directory
is returned.entry - A line of text from the file listingpublic static Calendar parseGMTdateTime(String timestamp)
timestamp - the date-time to parsenullpublic static java.time.Instant parseGmtInstant(String timestamp)
timestamp - the date-time to parsenull