code: public void setTargetDirectory(String directory) {
          if (directory != null && directory.length() > 0) {
              this.targetDirectory = new File(directory);
          } else {
              this.targetDirectory = null;
          }
      }
docs: Sets the target directory.