code: public void rename(String oldName, String newName)
          throws IOException, ServerException {
          if (oldName == null || newName == null) {
              throw new IllegalArgumentException("Required argument missing");
          }
          Command cmd = new Command("RNFR", oldName);
          try {
              Reply reply = controlChannel.exchange(cmd);
              if (!Reply.isPositiveIntermediate(reply)) {
                  throw new UnexpectedReplyCodeException(reply);
              }
              controlChannel.execute(new Command("RNTO", newName));
          } catch (FTPReplyParseException rpe) {
              throw ServerException.embedFTPReplyParseException(rpe);
          } catch (UnexpectedReplyCodeException urce) {
              throw ServerException.embedUnexpectedReplyCodeException(
                                  urce,
                                  "Server refused renaming file");
          }
      }
docs: Renames remote directory.