code: public void addWatchDirectory(File dir, String extension) {
          extension = removeStartingDotIfPresent(extension);
          List<String> fileExtensions = new ArrayList<String>();
          if (extension != null && extension.length() > 0) {
              int i = extension.lastIndexOf('.');
              if(i > -1) {
                  extension = extension.substring(i + 1);
              }
              fileExtensions.add(extension);
          }
          else {
              fileExtensions.add("*");
          }
          addWatchDirectory(dir, fileExtensions);
      }
docs: Adds a directory to watch for the given file and extensions.
  
  @param dir The directory
  @param extension The extension