title: Uploading a Directory using ftp4j
body: <p>I am trying to write a recursive function which will upload a directory entirely onto the ftp server. I need to check if the directory I am uploading is already there so I require to check if the dir exist. But in ftp4j I am not able to find any such functions as of now.</p>
  
  <p>Code:</p>
  
  <pre><code>if(!upclient.isConnected()){
      upclient.connect(ftp_ip);
      upclient.login(ftp_login, ftp_pass);
  }
  //i want to check here if the dir exit..if no i will create one
  upclient.changeDirectory(ftpupload_path);
  if (upclient.isConnected()) {
      System.out.println("Connected to " + ftp_ip);
      File local_dir=new File(local_path);
      File[] uploadFiles=local_dir.listFiles();
      for (File uploadfile : uploadFiles) {
          if(uploadfile.isFile()){
              System.out.println("Uploading" + upclient.currentDirectory() + "/" + uploadfile.getName());
      upclient.upload(uploadfile);
          } else if(uploadfile.isDirectory()){
              uploadDir(ftp_ip, ftp_login, ftp_pass,upclient.currentDirectory()+"/"+uploadfile.getName(), uploadfile.getAbsolutePath());
              upclient.changeDirectory(ftpupload_path);
          }
      }
  }
  </code></pre>