From 9e80d8e11cbeb6c85a4481d9f88b1083a2eaf346 Mon Sep 17 00:00:00 2001 From: "yuvaraj.s" Date: Thu, 30 Jun 2016 16:46:44 +0530 Subject: [PATCH] Correction in TempFilePath Property, split into TemporaryPath and TemporaryFilePath Change-Id: I50094e9063a75d0cee792741960c9db4b637d366 Signed-off-by: yuvaraj.s --- .../Tizen.Content.Download/Request.cs | 73 ++++++++++++---------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/src/Tizen.Content.Download/Tizen.Content.Download/Request.cs b/src/Tizen.Content.Download/Tizen.Content.Download/Request.cs index 3ffcfd7..1e3a9bb 100644 --- a/src/Tizen.Content.Download/Tizen.Content.Download/Request.cs +++ b/src/Tizen.Content.Download/Tizen.Content.Download/Request.cs @@ -359,6 +359,27 @@ namespace Tizen.Content.Download } /// + /// Full path of the temporary file which stores downloaded content. + /// + /// + /// The download state must be one of the states after Downloading. + /// + public string TemporaryPath + { + get + { + string path; + int ret = Interop.Download.GetTempFilePath(_downloadId, out path); + if (ret != (int)DownloadError.None) + { + Log.Error(Globals.LogTag, "Failed to get TemporaryPath, " + (DownloadError)ret); + return String.Empty; + } + return path; + } + } + + /// /// URL to download. /// /// @@ -511,38 +532,6 @@ namespace Tizen.Content.Download } /// - /// Directory path of the temporary file used in the previous download request. - /// This is only useful when resuming download to make HTTP request header at the client side. Otherwise, the path is ignored. - /// If you try to get this property value before setting or if any other error occurs, an empty string is returned. - /// - /// - /// If the etag value is not present in the download database, it is not useful to set the temporary file path. - /// When resuming download request, the data is attached at the end of this temporary file. - /// - public string TempFilePath - { - get - { - string path; - int ret = Interop.Download.GetTempFilePath(_downloadId, out path); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get TempFilePath, " + (DownloadError)ret); - return String.Empty; - } - return path; - } - set - { - int ret = Interop.Download.SetTempFilePath(_downloadId, value.ToString()); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to set TempFilePath"); - } - } - } - - /// /// HTTP header field and value pairs to the download request. /// HTTP header pair is the pair in the Dictionary HttpHeaders /// The given HTTP header field will be included with the HTTP request of the download request. @@ -561,6 +550,23 @@ namespace Tizen.Content.Download } /// + /// Sets the directory path of a temporary file used in a previous download request. + /// This is only useful when resuming download to make HTTP request header at the client side. Otherwise, the path is ignored. + /// + /// + /// If the etag value is not present in the download database, it is not useful to set the temporary file path. + /// When resuming the download request, the data is attached at the end of this temporary file. + /// + public void SetTemporaryFilePath(string path) + { + int ret = Interop.Download.SetTempFilePath(_downloadId, path); + if (ret != (int)DownloadError.None) + { + DownloadErrorFactory.ThrowException(ret, "Failed to set TemporaryFilePath"); + } + } + + /// /// Starts or resumes download. /// Starts to download the current URL, or resumes the download if paused. /// @@ -619,6 +625,9 @@ namespace Tizen.Content.Download /// /// Releases all resources used by the Request class. /// + /// + /// After calling this method, download request related data exists in the download database for a certain period of time. Within that time, it is possible to use other APIs with this data. + /// public void Dispose() { Dispose(true); -- 2.7.4