您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
48 行
1.3 KiB
48 行
1.3 KiB
using HuaweiService;
|
|
using HuaweiService.CloudStorage;
|
|
using UnityEngine;
|
|
|
|
namespace CloudStorageTest
|
|
{
|
|
public class ListResultTest
|
|
{
|
|
private AGCStorageManagement mAGCStorageManagement;
|
|
|
|
private void initAGCStorageManagement()
|
|
{
|
|
mAGCStorageManagement = AGCStorageManagement.getInstance();
|
|
}
|
|
|
|
public void run()
|
|
{
|
|
listResultTest();
|
|
Debug.Log("FileMetadataTest finished.");
|
|
}
|
|
|
|
private void listResultTest()
|
|
{
|
|
initAGCStorageManagement();
|
|
StorageReference reference = mAGCStorageManagement.getStorageReference();
|
|
|
|
Task listTask = reference.listAll();
|
|
ListResult listResult = HmsUtil.GetHmsBase<ListResult>(Tasks.await(listTask));
|
|
|
|
List fileList = listResult.getFileList();
|
|
if (fileList == null)
|
|
{
|
|
Debug.Log("listResultTest fail: fileList is null");
|
|
return;
|
|
}
|
|
|
|
List dirList = listResult.getDirList();
|
|
if (dirList == null)
|
|
{
|
|
Debug.Log("listResultTest fail: dirList is null");
|
|
return;
|
|
}
|
|
|
|
string pageMaker = listResult.getPageMarker();
|
|
Debug.Log("listResultTest success. pageMaker: " + pageMaker);
|
|
}
|
|
}
|
|
}
|