Update ...

This commit is contained in:
2026-10-22 23:30:09 +03:30
parent e9dd3b78f2
commit d0234fef2c
4 changed files with 10 additions and 153 deletions
-140
View File
@@ -1,140 +0,0 @@
using xExceptions.Attributes;
namespace xStorageService.Constants {
public enum FileExtensions {
//
// Document
[StringValue (".txt")]
TEXT = 100,
[StringValue (".pdf")]
PDF = 101,
[StringValue (".ppt")]
PPT = 102,
[StringValue (".pptx")]
PPTX = 103,
[StringValue (".odp")]
ODP = 104,
[StringValue (".pps")]
PPS = 105,
[StringValue (".ods")]
ODS = 106,
[StringValue (".xlr")]
XLR = 107,
[StringValue (".xls")]
XLS = 108,
[StringValue (".xlsx")]
XLSX = 109,
[StringValue (".xml")]
XML = 110,
[StringValue (".doc")]
DOC = 111,
[StringValue (".docx")]
DOCX = 112,
[StringValue (".odt")]
ODT = 113,
[StringValue (".rtf")]
RTF = 114,
[StringValue (".tex")]
TEX = 115,
[StringValue (".wpd")]
WPD = 116,
[StringValue (".md")]
MD = 117,
//
// Archive
[StringValue (".zip")]
ZIP = 200,
//
// Internal Supports
[StringValue (".ttf")]
TTF = 300,
[StringValue (".js")]
JAVASCRIPT = 301,
[StringValue (".css")]
CSS = 302,
[StringValue (".htm")]
HTM = 303,
[StringValue (".html")]
HTML = 304,
[StringValue (".sdw")]
SAHER_DASHBOARD_WIDGET = 305,
[StringValue (".sdwmanifest")]
SAHER_DASHBOARD_WIDGET_MANIFEST = 306,
//
// Video
[StringValue (".mp4")]
MP4 = 400,
[StringValue (".avi")]
AVI = 401,
[StringValue (".mpg")]
MPG = 402,
[StringValue (".mpeg")]
MPEG = 403,
[StringValue (".wmv")]
WMV = 404,
//
// Audio
[StringValue (".mp3")]
MP3 = 500,
[StringValue (".ogg")]
OGG = 501,
[StringValue (".wav")]
WAV = 502,
[StringValue (".wma")]
WMA = 503,
//
// Image
[StringValue (".png")]
PNG = 600,
[StringValue (".jpeg")]
JPEG = 601,
[StringValue (".jpg")]
JPG = 602,
// [StringValue (".ico")]
// ICON = 603,
[StringValue (".gif")]
GIF = 604,
[StringValue (".bmp")]
BITMAP = 605,
}
}
+3 -4
View File
@@ -4,7 +4,6 @@ using System.Linq;
using xCommons.Constants;
using xCommons.Extensions;
using xExceptions.Constants;
using xStorageService.Constants;
namespace xStorageService.Helpers {
public partial class XStorageHelper {
@@ -63,7 +62,7 @@ namespace xStorageService.Helpers {
/// <returns>an string array</returns>
public string[] GetAllowedExtensionsForWidgetUpload () {
return new [] {
FileExtensions.SAHER_DASHBOARD_WIDGET.GetStringValue ()
XFileExtensions.SAHER_DASHBOARD_WIDGET.GetStringValue ()
};
}
@@ -120,8 +119,8 @@ namespace xStorageService.Helpers {
public int GetExtensionType (string fileExtension) {
//
foreach (var extItem in Enum
.GetValues (typeof (FileExtensions))
.Cast<FileExtensions> ()) {
.GetValues (typeof (XFileExtensions))
.Cast<XFileExtensions> ()) {
if (extItem.GetStringValue ()
.Contains (fileExtension.ToLower ())) {
return (int) extItem;
+2 -3
View File
@@ -6,7 +6,6 @@ using System.Threading.Tasks;
using xStorageService.Models;
using xStorageService.Helpers;
using Microsoft.AspNetCore.Http;
using xStorageService.Constants;
using System.Collections.Generic;
using Microsoft.Extensions.FileProviders;
@@ -63,9 +62,9 @@ namespace xStorageService.Interfaces
string GetFileExtension(string fileName);
string GetFileNameWithoutExtension(string fileName);
FileExtensions GetFileExtensionType(string fileName);
XFileExtensions GetFileExtensionType(string fileName);
XFileType GetFileType(string fileName);
XFileType GetFileType(FileExtensions fileExtension);
XFileType GetFileType(XFileExtensions fileExtension);
string GetThumbnailFileFullPath(string thumFileName);
string GetRelatedThumbnailFullPath(string fileName);
string GetFileTypeFolderPath(XFileType type);
+5 -6
View File
@@ -10,7 +10,6 @@ using System.Threading.Tasks;
using xStorageService.Models;
using xStorageService.Helpers;
using Microsoft.AspNetCore.Http;
using xStorageService.Constants;
using System.Collections.Generic;
using xStorageService.Interfaces;
using System.Collections.ObjectModel;
@@ -522,7 +521,7 @@ namespace xStorageService.Providers
/// </summary>
/// <param name="fileName"></param>
/// <returns></returns>
public FileExtensions GetFileExtensionType(string fileName)
public XFileExtensions GetFileExtensionType(string fileName)
{
//
var fileExt = GetFileExtension(fileName);
@@ -539,7 +538,7 @@ namespace xStorageService.Providers
}
//
return (FileExtensions)result;
return (XFileExtensions)result;
}
/// <summary>
@@ -559,7 +558,7 @@ namespace xStorageService.Providers
/// </summary>
/// <param name="fileExtension"></param>
/// <returns></returns>
public XFileType GetFileType(FileExtensions fileExtension)
public XFileType GetFileType(XFileExtensions fileExtension)
{
return StorageHelper.GetType((int)fileExtension);
}
@@ -1020,8 +1019,8 @@ namespace xStorageService.Providers
{
//
var savedFileName = await SaveFileAsync(
file,
isTemp: false,
file,
isTemp: false,
isWidget: false,
cancellationToken: cancellationToken
);