From 82e4b7557b6c9ca529cda3dcf69b0fca4fb95aec Mon Sep 17 00:00:00 2001 From: Seokpil Park Date: Thu, 11 Apr 2013 18:40:19 +0900 Subject: [PATCH] [content] Add new exception to ContentTransfer Change-Id: I923875fc7e06e2edb93d9f3f1adc135e505193a9 Signed-off-by: Seokpil Park --- inc/FCntContentTransfer.h | 4 ++++ src/FCntContentTransfer.cpp | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/inc/FCntContentTransfer.h b/inc/FCntContentTransfer.h index b63a585..04f7dd2 100644 --- a/inc/FCntContentTransfer.h +++ b/inc/FCntContentTransfer.h @@ -191,6 +191,7 @@ public: * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. * @exception E_IN_PROGRESS A previous request is in progress. * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @see IContentTransferListener::OnContentDownloadCompleted() * @see IContentTransferListener::OnContentTransferInProgress() */ @@ -237,6 +238,7 @@ public: * @exception E_IN_PROGRESS A previous request is in progress. * @exception E_OUT_OF_MEMORY The memory is insufficient. * @exception E_SYSTEM A system error has occurred. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @remarks * - The @c progressInterval is the interval of the progress for each download request. If the value of the @c progressInterval is @c 0, the @c progressInterval uses the value set by the ContentTransfer::SetProgressIntervalByPercent(int). The @c progressInterval is a percentage value between @c 0 and @c 100. * - The @c timeout is the value of the response timeout for each download request. If the value of the @c timeout is @c 0, the value for the @c timeout uses the value set by the ContentTransfer::SetDefaultTimeout(int). @@ -289,6 +291,7 @@ public: * @exception E_INVALID_STATE This method is invalid for the current state of this instance. * @exception E_OUT_OF_MEMORY The memory is insufficient. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @see IContentTransferListener::OnContentDownloadToBufferCompleted() * @see IContentTransferListener::OnContentTransferInProgress() */ @@ -318,6 +321,7 @@ public: * @exception E_ILLEGAL_ACCESS Access is denied due to insufficient permission. * @exception E_IN_PROGRESS A previous request is in progress. * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @remarks * - The @c progressInterval is the interval of the progress for each download request. If the value of the @c progressInterval is @c 0, the @c progressInterval uses the value set by the ContentTransfer::SetProgressIntervalByPercent(int). The @c progressInterval is a percentage value between @c 0 and @c 100. * - The @c timeout is the value of the response timeout for each download request. If the value of the @c timeout is @c 0, the value for the @c timeout uses the value set by the ContentTransfer::SetDefaultTimeout(int). diff --git a/src/FCntContentTransfer.cpp b/src/FCntContentTransfer.cpp index 6853da8..9b3c5ba 100644 --- a/src/FCntContentTransfer.cpp +++ b/src/FCntContentTransfer.cpp @@ -195,8 +195,8 @@ ContentTransfer::Download(const Utility::Uri& uri, int fileSize, const String& d // Checks the privilege r = _AccessController::CheckUserPrivilege(_PRV_DOWNLOAD); - SysTryReturn(NID_CNT, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, - "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnResult(NID_CNT, r == E_SUCCESS, r, "The application is not permitted to call this method."); SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -215,8 +215,8 @@ ContentTransfer::Download(const Utility::Uri& uri, const String& filePath, // Checks the privilege r = _AccessController::CheckUserPrivilege(_PRV_DOWNLOAD); - SysTryReturn(NID_CNT, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, - "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnResult(NID_CNT, r == E_SUCCESS, r, "The application is not permitted to call this method."); SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -233,8 +233,8 @@ ContentTransfer::DownloadToBuffer(const Utility::Uri& uri, int fileSize, Request result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_DOWNLOAD); - SysTryReturn(NID_CNT, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, - "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnResult(NID_CNT, r == E_SUCCESS, r, "The application is not permitted to call this method."); SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -251,8 +251,8 @@ ContentTransfer::DownloadToBuffer(const Utility::Uri& uri, RequestId& reqId, int result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_DOWNLOAD); - SysTryReturn(NID_CNT, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, - "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnResult(NID_CNT, r == E_SUCCESS, r, "The application is not permitted to call this method."); SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use."); -- 2.7.4