简体   繁体   中英

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

(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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM