FTPEntry.parse constructor

FTPEntry.parse(
  1. String responseLine,
  2. ListCommand cmd
)

Implementation

factory FTPEntry.parse(String responseLine, ListCommand cmd) {
  if (responseLine.trim().isEmpty) {
    throw FTPConnectException("Can't parse a null or blank response line");
  }
  if (cmd == ListCommand.LIST) {
    return FTPEntry._parseListCommand(responseLine);
  } else if (cmd == ListCommand.NLST) {
    return FTPEntry._(responseLine, null, null, FTPEntryType.UNKNOWN, null,
        null, null, null, null, null, null, null);
  } else {
    return FTPEntry._parseMLSDCommand(responseLine);
  }
}