'(Private) Parses the response messages from the FTP server.'

def lineReceived(self, line):

    if (bytes != str):
        line = line.decode(self._encoding)
    if self.debug:
        log.msg(('-->    %s' % line))
    self.response.append(line)
    codeIsValid = re.match('\\d{3}    ', line)
    if (not codeIsValid):
        return
    code = line[0:3]
    if (code[0] == '1'):
        return
    if (self.nextDeferred is None):
        self.fail(UnexpectedResponse(self.response))
        return
    response = self.response
    self.response = []
    if (code[0] in ('2', '3')):
        self.nextDeferred.callback(response)
    elif (code[0] in ('4', '5')):
        self.nextDeferred.errback(failure.Failure(CommandFailed(response)))
    else:
        log.msg(('Server    sent    invalid    response    code    %s' % (code,)))
        self.nextDeferred.errback(failure.Failure(BadResponse(response)))
    self.sendNextCommand()
