azure storage files - AzureStorage CloudFileDirectory.ListFilesAndDirectories worthless? -


so far handle on cloudfiledirectory , calling method gives me list of ilistfileitem objects, 1 each file , directory in given cloudfiledirectory, i'm having trouble distinguishing files , directories.

properties available on ilistfileitem include uri, system.uri object, has isfile member, shows false files and directories.

i need lists of directories can drill into, lists of files can work with, far can't find way filter mixed list.

i can't think of worthwhile use mixed list. wonder why m$ didn't expose listfiles , listdirectories separate methods. maybe had trouble distinguishing them , gave up.

i found answer here... robindotnet's blog using azure files preview storage client library

casting received ilistfileitem cloudfile works files, otherwise resulting in null, , casting cloudfiledirectory works directories.

i ended using linq...

var azuredirectories = myshare.getrootdirectoryreference()     .getdirectoryreference(mypath)     .listfilesanddirectories()     .oftype<cloudfiledirectory>();  var azurefiles = myshare.getrootdirectoryreference()     .getdirectoryreference(mypath)     .listfilesanddirectories()     .oftype<cloudfile>(); 

Comments