Esempio n. 1
0
 /// <summary>
 /// Requests a download token for a given resource.
 /// </summary>
 /// <param name="virtualFilePath">Identifies the resource to be downloaded.</param>
 /// <param name="includeFileHash">Whether a file hash for the
 /// requested resource should be calculated and assigned to the
 /// <see cref="DownloadToken.Md5FileHash"/> property of the returned
 /// <see cref="DownloadToken"/>.</param>
 /// <returns>A token that represents a granted resource download, optionally
 /// limited to a given time frame (<see cref="TransferToken.ExpirationTime"/>).</returns>
 /// <exception cref="VirtualResourceNotFoundException">If the submitted <paramref name="virtualFilePath"/>
 /// does not match an existing resource.</exception>
 /// <exception cref="ResourceAccessException">If the request was not authorized.</exception>
 /// <exception cref="ResourceLockedException">If a lock to access the
 /// resource was not granted.</exception>
 public DownloadToken RequestDownloadToken(string virtualFilePath, bool includeFileHash)
 {
     return(SecureFunc(FileSystemTask.DownloadTokenRequest,
                       () => ReaderService.RequestDownloadToken(virtualFilePath, includeFileHash),
                       () => String.Format("Download token request for file [{0}] failed.", virtualFilePath)));
 }