Class MLSxEntryParser
java.lang.Object
org.apache.commons.net.ftp.FTPFileEntryParserImpl
org.apache.commons.net.ftp.parser.MLSxEntryParser
- All Implemented Interfaces:
FTPFileEntryParser
Parser class for MSLT and MLSD replies. See RFC 3659.
Format is as follows:
entry = [ facts ] SP pathname
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.
- Since:
- 3.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreate the parser for MSLT and MSLD listing entries This class is immutable, so one can usegetInstance()instead. -
Method Summary
Modifier and TypeMethodDescriptionstatic MLSxEntryParserstatic FTPFileparseEntry(String entry) parseFTPEntry(String entry) Parses a line of an FTP server file listing and converts it into a usable format in the form of anFTPFileinstance.static CalendarparseGMTdateTime(String timestamp) Parse a GMT time stamp of the form yyyyMMDDHHMMSS[.sss]static InstantparseGmtInstant(String timestamp) Parse a GMT time stamp of the form yyyyMMDDHHMMSS[.sss]Methods inherited from class org.apache.commons.net.ftp.FTPFileEntryParserImpl
preParse, readNextEntry
-
Constructor Details
-
MLSxEntryParser
public MLSxEntryParser()Create the parser for MSLT and MSLD listing entries This class is immutable, so one can usegetInstance()instead.
-
-
Method Details
-
getInstance
-
parseEntry
-
parseGMTdateTime
Parse a GMT time stamp of the form yyyyMMDDHHMMSS[.sss]- Parameters:
timestamp- the date-time to parse- Returns:
- a Calendar entry, may be
null - Since:
- 3.4
-
parseGmtInstant
Parse a GMT time stamp of the form yyyyMMDDHHMMSS[.sss]- Parameters:
timestamp- the date-time to parse- Returns:
- a Calendar entry, may be
null - Since:
- 3.9.0
-
parseFTPEntry
Description copied from interface:FTPFileEntryParserParses a line of an FTP server file listing and converts it into a usable format in the form of anFTPFileinstance. If the file listing line doesn't describe a file,nullshould be returned, otherwise aFTPFileinstance representing the files in the directory is returned.- Parameters:
entry- A line of text from the file listing- Returns:
- An FTPFile instance corresponding to the supplied entry
-