code: public static String getContentId(File file,
                                        File watchDir,
                                        String contentIdPrefix) {
          String contentId = file.getName();
          if (null != watchDir) {
              URI relativeFileURI = watchDir.toURI().relativize(file.toURI());
              contentId = relativeFileURI.getPath();
          }
          if (null != contentIdPrefix) {
              contentId = contentIdPrefix + contentId;
          }
          return contentId;
      }
docs: Determines the content ID of a file: the path of the file relative to
  the watched directory. If the watched directory is null, the content ID
  is simply the name of the file.
  
  If a prefix is being used, the prefix is added as the initial characters
  in the contentId.
  
  @param file
  @param watchDir
  @param contentIdPrefix
  @return