Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FileRevocationManager.GetStatusAsync | getStatusAsync method

[FileRevocationManager may be unavailable for releases after Windows 10. Instead, use FileProtectionManager.]

Note  Windows Information Protection (WIP) policy cannot be applied on Windows 10, version 1511 (build 10586) or earlier.
 

Gets the selective wipe protection status for a file or folder.

Syntax


Windows.Security.EnterpriseData.FileRevocationManager.getStatusAsync(storageItem).done( /* Your success and error handlers */ );

Parameters

storageItem

Type: IStorageItem

The file or folder to get the selective wipe protection status for.

Return value

Type: IAsyncOperation<FileProtectionStatus>

An aysnchronous operation that retrieves the selective wipe protection status for the storageItem.

Remarks

You can use the GetStatusAsync method to determine the Selective Wipe protection status of a file or folder. This will tell you if a file is protected or not, if a file is protected by another user on the computer, and so on. A common use of the GetStatusAsync method is to determine when a protected file should be deleted. For example, when a protected file is revoked, an attempt to access the file contents will result in an "Access is denied" exception. When you encounter that exception, you can use the GetStatusAsync method to determine if the file has been revoked by Selective Wipe and then delete the file if it has, as shown in the following example.


ApplicationData appRootFolder = ApplicationData.Current;
string enterpriseIdentity = "example.com";
int AccessDeniedHResult = -2147024891;  // Access Denied (0x80070005)



var appRootFolder = Windows.Storage.ApplicationData.current;
var enterpriseIdentity = "example.com";
var accessDeniedHResult = -2147024891;  // Access Denied (0x80070005)



function getFileContents(filePath) {
    var stream;
    var file;

    Windows.Storage.StorageFile.getFileFromPathAsync(filePath).then(
        function (f) {
            file = f;
            file.openReadAsync().then(
                function (s) {
                    stream = s;
                    return stream;
                },
                function (err) {
                    if (err.number == accessDeniedHResult) {
                        // Delete file if it has been revoked.
                        selectiveWipeCleanup(file);
                    }
                });
        });

    return null;
}

// Delete items revoked by Selective Wipe.
function selectiveWipeCleanup(file) {
    Windows.Security.EnterpriseData.FileRevocationManager.
        getStatusAsync(file).then(
            function (status) {
                if (status == 
                    Windows.Security.EnterpriseData.FileProtectionStatus.revoked) {
                        file.deleteAsync();
                }
        });

}


Requirements (Windows 10 device family)

Device family

Desktop, introduced version 10.0.10240.0
Mobile, introduced version 10.0.10240.0

API contract

Windows.Security.EnterpriseData.EnterpriseDataContract, introduced version 1.0

Namespace

Windows.Security.EnterpriseData
Windows::Security::EnterpriseData [C++]

Metadata

Windows.Security.EnterpriseData.EnterpriseDataContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

None supported

Namespace

Windows.Security.EnterpriseData
Windows::Security::EnterpriseData [C++]

Metadata

Windows.winmd

Attributes

[Deprecated()]

See also

FileRevocationManager
FileRevocationManager sample
How to protect files with Selective Wipe (C#/VB/C++)
How to protect files with Selective Wipe (JavaScript)

 

 

Show: