Refactoring and added common utils
This commit is contained in:
@@ -42,7 +42,7 @@ private:
|
||||
tempPath.resize(MAX_PATH + 1);
|
||||
if (GetTempPath(MAX_PATH + 1, &tempPath[0]))
|
||||
{
|
||||
ret = API_SUCCESS(SiaApiError, _siaApi->GetRenter()->DownloadFile(siaPath, tempPath));
|
||||
ret = ApiSuccess(_siaApi->GetRenter()->DownloadFile(siaPath, tempPath));
|
||||
if (ret)
|
||||
{
|
||||
|
||||
@@ -158,7 +158,7 @@ private:
|
||||
else
|
||||
{
|
||||
bool exists;
|
||||
if (API_SUCCESS(SiaApiError, _siaApi->GetRenter()->FileExists(siaPath, exists)))
|
||||
if (ApiSuccess(_siaApi->GetRenter()->FileExists(siaPath, exists)))
|
||||
{
|
||||
// Operations on existing files that are requested to be truncated, overwritten or re-created
|
||||
// will first be deleted and then replaced if, after the file operation is done, the resulting file
|
||||
@@ -227,7 +227,7 @@ private:
|
||||
// If file isn't cached, delete from Sia only
|
||||
if (!PathFileExists(cacheFilePath.c_str()) || ::DeleteFile(cacheFilePath.c_str()))
|
||||
{
|
||||
if (!API_SUCCESS(SiaApiError, _siaApi->GetRenter()->DeleteFile(siaPath)))
|
||||
if (!ApiSuccess(_siaApi->GetRenter()->DeleteFile(siaPath)))
|
||||
{
|
||||
ret = STATUS_INVALID_SERVER_STATE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user