Revision 126f90b3 trunk/Pithos.Network/CloudFilesClient.cs
b/trunk/Pithos.Network/CloudFilesClient.cs | ||
---|---|---|
318 | 318 |
{ |
319 | 319 |
if (Log.IsDebugEnabled) Log.DebugFormat("START"); |
320 | 320 |
|
321 |
var objects = new List<ObjectInfo>(); |
|
322 | 321 |
var accounts = ListSharingAccounts(since); |
323 |
foreach (var account in accounts) |
|
322 |
var items = from account in accounts |
|
323 |
let containers = ListContainers(account.name) |
|
324 |
from container in containers |
|
325 |
select ListObjects(account.name, container.Name); |
|
326 |
var objects=items.SelectMany(r=> r).ToList(); |
|
327 |
/* |
|
328 |
var objects = new List<ObjectInfo>(); |
|
329 |
foreach (var containerObjects in items) |
|
324 | 330 |
{ |
325 |
var containers = ListContainers(account.name); |
|
326 |
foreach (var container in containers) |
|
327 |
{ |
|
328 |
var containerObjects = ListObjects(account.name, container.Name); |
|
329 |
objects.AddRange(containerObjects); |
|
330 |
} |
|
331 |
objects.AddRange(containerObjects); |
|
331 | 332 |
} |
333 |
*/ |
|
332 | 334 |
if (Log.IsDebugEnabled) Log.DebugFormat("END"); |
333 | 335 |
return objects; |
334 | 336 |
} |
... | ... | |
603 | 605 |
|
604 | 606 |
client.AssertStatusOK("ListObjects failed"); |
605 | 607 |
|
608 |
//HACK: Must add it to all other operations as well |
|
609 |
StatusCode = client.StatusCode; |
|
606 | 610 |
//If the result is empty, return an empty list, |
607 | 611 |
var infos = String.IsNullOrWhiteSpace(content) |
608 | 612 |
? new List<ObjectInfo>() |
... | ... | |
615 | 619 |
info.Account = account; |
616 | 620 |
info.StorageUri = this.StorageUrl; |
617 | 621 |
} |
618 |
if (Log.IsDebugEnabled) Log.DebugFormat("START");
|
|
622 |
if (Log.IsDebugEnabled) Log.DebugFormat("END");
|
|
619 | 623 |
return infos; |
620 | 624 |
} |
621 | 625 |
} |
622 | 626 |
} |
623 | 627 |
|
628 |
public HttpStatusCode StatusCode { get; set; } |
|
624 | 629 |
|
625 | 630 |
|
626 | 631 |
public IList<ObjectInfo> ListObjects(string account, string container, string folder, DateTime? since = null) |
Also available in: Unified diff