code: private static String checkFolder(String directory) {
          File dir = new File(directory);
          if (dir.isFile()) {
              directory = dir.getParent();
          }
          createFolder(directory);
          return directory;
      }
docs: 检查文件夹，如果不存在则创建，如果是文件则获取上级目录
  
  @param directory 文件夹
  
  @return 文件夹路径