开发者

Rackspace CloudFiles C# API: How to list files on root 'folder', and how to list (sub)folders within a 'folder'?

开发者 https://www.devze.com 2023-04-08 02:27 出处:网络
(1) I can list the files on a folder this way: var parameters = new Dictionary<GetListParameters, string>();

(1) I can list the files on a folder this way:

var parameters = new Dictionary<GetListParameters, string>();
parameters.Add(GetListParameters.Path, "folder1/"); // get items from this specific path 
var containerItemList = connection.GetContainerItemList(Settings.ContainerName, parameters);

However, this:

parameters.Add(GetListParameters.Path, "/");

or this:

parameters.Add(GetListParameters.Path, "");

does not work.

How can I query the files on the root folder?

(2) The code above returns the list of files in a folder.

How can I get the list of folders within a folder? I there any parameter I can set to get this list?

Note: I know that this is a 'flat' file system, similar to Amazon S3. However, both (cloudfiles and S3) provides a way to work with 'folder'. In S3 is easy. In cloudfiles (with the .net API) I could 开发者_开发技巧not find how to do this.

Any hint will be highly appreciated.


This has just been fixed with the latest push and closes issue #51 on github

Link to downloadable package

Hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消