Reputation: 738
Using the Dropbox .NET SDK for the v2 API, can a file/folder MetaData object have both the IsFile/IsFolder property set to true along with the IsDeleted property? Or are these three properties mutually exclusive.
For example, if a file was deleted, would the code in the if statement be executed:
ListFolderResult listFolderResult = await dbx.Files.ListFolderAsync(string.Empty);
Metadata metaData = listFolderResult.Entries.ElementAt(0);
if(metaData.IsFile && metaData.IsDeleted)
{
// could this occur
}
Upvotes: 0
Views: 66
Reputation: 60143
The three are mutually exclusive. A good tip is to check out the HTTP documentation: https://www.dropbox.com/developers/documentation/http#documentation-files-list_folder. If you expand the definition of Metadata there, you'll see that it's always just one of those three subtypes:
Metadata (datatype with subtypes)
Metadata for a file or folder.
This datatype will be one of the following subtypes:
- file FileMetadata
- folder FolderMetadata
- deleted DeletedMetadata
Upvotes: 1