CfApi: How to implement Streaming Mode?

WebDAV 106 Reputation points
2021-11-20T10:09:59.357+00:00

I want to implement the Cloud Files drive with streaming mode support. I guess this allows building a cloud drive with higher security - no data will be kept on the client-side on disk and all file content and folder content will be automatically deleted.

When creating a drive I set the StreamingAllowed flag:

storageInfo.HydrationPolicy = StorageProviderHydrationPolicy.Progressive;  
storageInfo.HydrationPolicyModifier = StorageProviderHydrationPolicyModifier.StreamingAllowed | StorageProviderHydrationPolicyModifier.AutoDehydrationAllowed;  
storageInfo.PopulationPolicy = StorageProviderPopulationPolicy.Full;  

The description of the streaming mode says:

This modifier does not allow the platform to store any data on disk returned by a sync provider.

and also:

grants the platform the permission to not store any data returned by a sync provider on local disks.

My folders content is successfully listed and file content is properly hydrated when I open a file. The folder content is listed on every interaction with Windows Explorer, making a lot of folder listing requests, but I am ok with it as soon as it brings high security.

However, the content of the hydrated files stays on disk and is never deleted, even after machine reboot and when my app is not running and callbacks are not attached. The user can access it for example via a recent files list.

Should I somehow dehydrate files myself or the platform will delete files' content and listed folders automatically at some point?

@Rita Han - MSFT

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
727 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,429 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Umang Mital 1 Reputation point
    2023-01-30T14:36:33.7566667+00:00

    Hi, I am also facing the same issue, while trying to implement similar scenario. We want to maintain our own caching mechanism for extra prefetching and managing cache size, so we don't want any data to be cache by file provider, it can request whatever it needs, and we will provide the data (either from cache or from cloud), so I though using Streaming_allowed policy will help, but I am also not able to get it working.

    Could you please a example of how to use this hydration policy ?