开发者

Rackspace CloudFiles: Check for the existence of a file

I want to check for the existence of a file on the CDN through my site's code via the Rackspace Cloud API.

What would the best way to do this be? I am currently using the following:

... initialize API ... 

Dim containerItemList As List(Of String) = connection.GetContainerItemList("MyCDN") 

If containerItemList.Contains(MyFile) Then 
  'Blah blah 
End If 

This isn't working for some reason - the containerItemList is always empty. My container definitely has objects, and the name of the container is right (including case).

Is there a better/different way to search/check for the existence of a file? Ideally, it should be a case-insensitive search.

Another way would be to try and get the object using something like connection.GetStorageItem, and check for exceptions, but obviously that would hurt performance.

Any ideas? Code in any language would be fine, I'开发者_如何学Gom just looking for the best way to do this.

Thanks in advance!

WT


This appears to be a bug, that was fixed by a member of the community: https://github.com/rackspace/csharp-cloudfiles/issues/unreads#issue/6

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜