Grizzly il y a 5 mois
Parent
commit
04de10e165

+ 4 - 3
src/main/java/edu/nju/software/aipaasagent/mcp/tool/examples/ResourceDownloadTool.java

@@ -43,12 +43,13 @@ public class ResourceDownloadTool {
                 destPath = savePath;
             }
             
-            long file = HttpUtil.downloadFile(url, destPath);
+            long fileSize = HttpUtil.downloadFile(url, destPath);
+            File downloadedFile = new File(destPath);
             
             String result = String.format(
                 "文件下载成功\n保存路径: %s\n文件大小: %s",
-                    file,
-                FileUtil.readableFileSize(file)
+                downloadedFile.getAbsolutePath(),
+                FileUtil.readableFileSize(fileSize)
             );
             
             log.info(result);