💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 组件源码 /** * <b>方法描述:</b> 新建日期文件夹 <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2019-08-16 09:48:21 <br/> * * @param path * 入参|目录|{@link java.lang.String} * @param newpath * 出参|新的输出文件夹|{@link java.lang.String} * @return 0 失败<br/> * 1 成功<br/> */ @Component(label = "新建日期文件夹", style = "判断型", type = "同步组件", comment = "现有目录拼接日期文件夹,格式:yyyymmddd", version = "1.0.0", deprecated = false, author = "admin", date = "2019-08-16 09:48:21") @InParams(param = { @Param(name = "path", comment = "目录", type = java.lang.String.class) }) @OutParams(param = { @Param(name = "newpath", comment = "新的输出文件夹", type = java.lang.String.class) }) @Returns(returns = { @Return(id = "0", desp = "失败"), @Return(id = "1", desp = "成功") }) public static ResultBase A_filePath(String path) { Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); String dateStr = sdf.format(date); if (!path.endsWith("/")) path += "/"; String filepath = path + dateStr; File file = new File(filepath); if (!file.exists()) file.mkdirs(); return ResultBase.newSuccessResult(file.getAbsolutePath()); } 交易中组件使用方式: ![](https://img.kancloud.cn/5f/aa/5faa7ad9c9125829d5bc0c1c91d9dfec_950x750.jpg) ## 参数说明及示例 目录:输出目录路径,示例: `"/home/usr/local/"` 新的输出文件夹:输出文件夹路径,示例: `__INNER__["filepath"]`的结果等于`/home/usr/local/20210127` > 现有目录拼接日期文件夹,格式:yyyymmddd