AS AgentScopeAPI 手册 / API Reference

FileInfo

public record FileInfo(String path, boolean isDirectory, long size, String modifiedAt)
源码Source io/agentscope/harness/agent/filesystem/model/FileInfo.java:27–46

承载文件信息数据的记录类型。位于 io.agentscope.harness.agent.filesystem.model 包。核心成员包括 path、isDirectory、size、modifiedAt、ofFile、ofDir。

Structured file listing info. Only path is required; other fields are best-effort and may be absent depending on filesystem implementation.

记录组件摘要Record Component Summary

组件Component类型Type说明Description
pathString
执行路径相关操作。
absolute or relative file path
isDirectoryboolean
判断是否条目是目录。
whether the entry is a directory
sizelong
执行大小相关操作。
file size in bytes (approximate)
modifiedAtString
执行 `modifiedAt` 方法。
ISO 8601 timestamp of last modification, or empty string if unknown

方法摘要Method Summary

方法Method说明Description
public static FileInfo ofFile(String path, long size, String modifiedAt)
static
执行的文件相关操作。
Performs the of file operation.
public static FileInfo ofDir(String path, String modifiedAt)
static
执行的目录相关操作。
Performs the of dir operation.
public static FileInfo ofFile(String path, long size, long lastModifiedMs)
static
执行的文件相关操作。
Performs the of file operation.
public static FileInfo ofDir(String path, long lastModifiedMs)
static
执行的目录相关操作。
Performs the of dir operation.

记录组件详情Record Component Detail

path

String path

执行路径相关操作。

absolute or relative file path

源码Source io/agentscope/harness/agent/filesystem/model/FileInfo.java:27–46

isDirectory

boolean isDirectory

判断是否条目是目录。

whether the entry is a directory

源码Source io/agentscope/harness/agent/filesystem/model/FileInfo.java:27–46

size

long size

执行大小相关操作。

file size in bytes (approximate)

源码Source io/agentscope/harness/agent/filesystem/model/FileInfo.java:27–46

modifiedAt

String modifiedAt

执行 modifiedAt 方法。

ISO 8601 timestamp of last modification, or empty string if unknown

源码Source io/agentscope/harness/agent/filesystem/model/FileInfo.java:27–46

方法详情Method Detail

ofFile

public static FileInfo ofFile(String path, long size, String modifiedAt)
static

执行的文件相关操作。

Performs the of file operation.

参数Parameters
名称Name类型Type说明Description
pathString路径(类型 `String`)。The path.
sizelong大小(类型 `long`)。The size.
modifiedAtStringmodified At(类型 `String`)。The modified at.
返回Returns FileInfo
返回FileInfo。Returns file info.
源码Source io/agentscope/harness/agent/filesystem/model/FileInfo.java:29–31

ofDir

public static FileInfo ofDir(String path, String modifiedAt)
static

执行的目录相关操作。

Performs the of dir operation.

参数Parameters
名称Name类型Type说明Description
pathString路径(类型 `String`)。The path.
modifiedAtStringmodified At(类型 `String`)。The modified at.
返回Returns FileInfo
返回FileInfo。Returns file info.
源码Source io/agentscope/harness/agent/filesystem/model/FileInfo.java:33–35

ofFile

public static FileInfo ofFile(String path, long size, long lastModifiedMs)
static

执行的文件相关操作。

Performs the of file operation.

参数Parameters
名称Name类型Type说明Description
pathString路径(类型 `String`)。The path.
sizelong大小(类型 `long`)。The size.
lastModifiedMslong最后 Modified Ms(类型 `long`)。The last modified ms.
返回Returns FileInfo
返回FileInfo。Returns file info.
源码Source io/agentscope/harness/agent/filesystem/model/FileInfo.java:37–40

ofDir

public static FileInfo ofDir(String path, long lastModifiedMs)
static

执行的目录相关操作。

Performs the of dir operation.

参数Parameters
名称Name类型Type说明Description
pathString路径(类型 `String`)。The path.
lastModifiedMslong最后 Modified Ms(类型 `long`)。The last modified ms.
返回Returns FileInfo
返回FileInfo。Returns file info.
源码Source io/agentscope/harness/agent/filesystem/model/FileInfo.java:42–45
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.