💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 组件源码 ``` /** * <b>方法描述:</b> 文件大小 <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2018-04-25 17:04:13 <br/> * * @param filename * 入参|输入文件名|{@link java.lang.String} * @param filesize * 出参|文件大小|{@link java.lang.Long} * @return 0 失败<br/> * 1 成功<br/> */ @Component(label = "文件大小", style = "判断型", type = "同步组件", comment = "获取文件大小,单位b;", version = "1.0.0", deprecated = false, author = "admin", date = "2018-04-25 05:04:13") @InParams(param = { @Param(name = "filename", comment = "输入文件名", type = java.lang.String.class) }) @OutParams(param = { @Param(name = "filesize", comment = "文件大小", type = java.lang.Long.class) }) @Returns(returns = { @Return(id = "0", desp = "失败"), @Return(id = "1", desp = "成功") }) public static ResultBase P_fileSize(String filename) { File file = new File(filename); if (!file.exists() || !file.isFile()) { return ResultBase .newFailureResult("TPTF0037", "文件不存在:"+filename); } return ResultBase.newSuccessResult(new Long(file.length())); } ``` # 交易中组件使用方式 ![](https://img.kancloud.cn/53/07/5307e29159a72a644c558e2e0fcd9fde_1869x891.png) # 参数说明及示例 ## 入口参数 输入文件名:文件的绝对路径,示例: `"D:\\work\\CQYY\\workspace\\xxx.txt"` ## 出口参数 文件大小:输入文件的大小,示例: `__INNER__["size"]`