2 回答
TA贡献1775条经验 获得超11个赞
您可以将getProperties方法用于fetching metadata和file。directory下面是这个方法的定义:
返回文件的所有用户定义元数据、标准 HTTP 属性和系统属性。它不返回文件的内容。
所以在你的代码 -> 里面for await (const item of dirIter),你需要判断是不是fileor directory,然后调用getProperties()方法。示例代码如下所示:
for await (const item of dirIter) {
if (item.kind === "directory") {
const mydirectory = directoryClient.getDirectoryClient(item.name);
var diretory_properties = await mydirectory.getProperties();
//for test, you can print out the metadata
console.log(diretory_properties.metadata);
//here, you can write code to add the metadata in your list
} else {
const myfile=directoryClient.getFileClient(item.name);
var the_properties = await myfile.getProperties();
//for test, you can print out the metadata
console.log(the_properties.metadata)
//here, you can write code to add the metadata in your list
}
}
TA贡献1921条经验 获得超9个赞
您可以使用该方法getShareMetadata
fileService.getShareMetadata(shareName, function (error, result, response) {
添加回答
举报