def cwd(self, directory, connId='<STR_LIT:default>'):
thisConn = self.__getConnection(connId)<EOL>outputMsg = "<STR_LIT>"<EOL>try:<EOL><INDENT>outputMsg += thisConn.cwd(directory)<EOL><DEDENT>except ftplib.all_errors as e:<EOL><INDENT>raise FtpLibraryError(str(e))<EOL><DEDENT>if self.printOutput:<EOL><INDENT>logger.info(outputMsg)<EOL><DEDENT>return outputMsg<EOL>
Changes working directory and returns server output. Parameters:
- directory - a path to which working dir should be changed.
- connId(optional) - connection identifier. By default equals 'default'
Example:
| cwd | /home/myname/tmp/testdir |  |
| cwd | /home/myname/tmp/testdir | ftp1 |