public bool PostEmptySelectedTempDirectories(List <HKTempModel> selectedTempItemsToDelete)
        {
            try
            {
                foreach (var tempItem in selectedTempItemsToDelete)
                {
                    if (tempItem.Selected)
                    {
                        if (tempItem.Type == "directory")
                        {
                            DirectoryInfo selectedDirectory = new DirectoryInfo(HttpContext.Current.Server.MapPath(GlobalSettings.Path + "/../App_Data/TEMP/" + tempItem.Entry + "/"));
                            // Delete cache folder recursively
                            HkFunctionsHelper.DeleteFolderRecursive(tempDI, selectedDirectory);
                        }
                        else
                        {
                            FileInfo selectedFile = new FileInfo(HttpContext.Current.Server.MapPath(GlobalSettings.Path + "/../App_Data/TEMP/" + tempItem.Entry));
                            HkFunctionsHelper.DeleteFile(tempDI, selectedFile);
                        }
                    }
                }

                return(true);
            }
            catch (IOException ex)
            {
                return(false);
            }
        }
        public bool PostEmptyCacheDirectory()
        {
            try
            {
                // Delete cache folder recursively
                HkFunctionsHelper.DeleteFolderRecursive(cacheDI, cacheDI);

                return(true);
            }
            catch (IOException ex)
            {
                return(false);
            }
        }
        public override ActionResult Index(RenderModel model)
        {
            try
            {
                HKCachePageModel HKRecycleBinPageModel = new HKCachePageModel(model.Content, model.CurrentCulture);

                // Delete cache folder recursively
                DirectoryInfo cacheDI = new DirectoryInfo(HttpContext.Server.MapPath(GlobalSettings.Path + "/../App_Data/cache/"));
                HkFunctionsHelper.DeleteFolderRecursive(cacheDI, cacheDI);

                HKRecycleBinPageModel.IsCacheDirectoryCleaned = true;

                LogHelper.Info <string>("FALM Housekeeping - Cleanup Cache Directory successfully completed");

                return(CurrentTemplate(HKRecycleBinPageModel));
            }
            catch (Exception ex)
            {
                LogHelper.Error <Exception>("FALM Housekeeping - " + ex.Message, ex);

                throw new Exception(ex.Message);
            }
        }