FileRevocationManager.CopyProtectionAsync | copyProtectionAsync method

Applies to Windows only

Copy the selective wipe protection state of a file or folder to a new file or folder.

Syntax


Windows.Security.EnterpriseData.FileRevocationManager.copyProtectionAsync(sourceStorageItem, targetStorageItem).done( /* Your success and error handlers */ );

Parameters

sourceStorageItem

Type: IStorageItem

The source item to copy the selective wipe protection status from.

targetStorageItem

Type: IStorageItem

The target item to copy the selective wipe protection status to.

Return value

Type: IAsyncOperation<Boolean>

True if the copy operation was successful; otherwise false.

Remarks

If you save a new copy of a file as the result of a "save as" operation, the selective wipe protection status is not copied with the file. To protect the file, you must call the CopyProtectionAsync method to copy the existing protection status to the new file. If you copy a protected file using the CopyAsync or CopyAndReplaceAsync methods, the selective wipe protection status is copied with the file and you do not need to call the CopyProtectionAsync method.


function copyFile(file, newFolder) {
    file.copyAsync(newFolder).then(
        function (newFile) {
            Windows.Security.EnterpriseData.FileRevocationManager.
                copyProtectionAsync(file, newFile);
        },
        function (err) {
            // Handle error. For example, copy already exists.
        });
}


The CopyProtectionAsync method requires exclusive access to the file or folder being encrypted, and will fail if another process is using has a handle open to the file or folder.

Requirements

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

See also

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

 

 

Show:
© 2014 Microsoft