code: public String getLabel(String path) {
          if (labelGenerator != null) {
              return labelGenerator.getLabelForPath(path).toString();
          }
          if (fileNameMap != null && fileNameMap.containsKey(path))
              return fileNameMap.get(path);
          return (new File(path)).getParentFile().getName();
      }
docs: Get the label from the given path
  
  @param path the path to get the label from
  @return the label for the given path