code: public static String dirname(String path)
      {
          int index = path.lastIndexOf('/');
          if (index == -1) return path;
          return path.substring(0, index + 1);
      }
docs: 获取文件所在目录的路径
  @param path
  @return