Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e701376df | ||
|
|
41f220d145 | ||
|
|
c3b9b3e43a | ||
|
|
8a66b8b7e9 | ||
|
|
7e08427539 | ||
|
|
b26767e126 | ||
|
|
83b907988b | ||
|
|
dd23ed4f64 | ||
|
|
330a3958f3 | ||
|
|
d85dbcfdf7 |
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.Extensions.FileProviders;
|
using Microsoft.Extensions.FileProviders;
|
||||||
@@ -11,7 +12,8 @@ using xStorageService.Models;
|
|||||||
|
|
||||||
namespace xStorageService.Interfaces
|
namespace xStorageService.Interfaces
|
||||||
{
|
{
|
||||||
public partial interface IXStorageProvider {
|
public partial interface IXStorageProvider
|
||||||
|
{
|
||||||
XStorageConfiguration Configuration { get; }
|
XStorageConfiguration Configuration { get; }
|
||||||
XStorageHelper StorageHelper { get; }
|
XStorageHelper StorageHelper { get; }
|
||||||
IFileProvider FileProvider { get; }
|
IFileProvider FileProvider { get; }
|
||||||
@@ -19,84 +21,101 @@ namespace xStorageService.Interfaces
|
|||||||
|
|
||||||
//
|
//
|
||||||
#region Special Folders Path Getter (s) ...
|
#region Special Folders Path Getter (s) ...
|
||||||
string GetStorageFolderPath ();
|
string GetStorageFolderPath();
|
||||||
string GetTempFolderPath ();
|
string GetTempFolderPath();
|
||||||
string GetThumbFolderPath ();
|
string GetThumbFolderPath();
|
||||||
string GetUploadsFolderPath ();
|
string GetUploadsFolderPath();
|
||||||
string GetWidgetsFolderPath ();
|
string GetWidgetsFolderPath();
|
||||||
string GetImageFolderPath ();
|
string GetImageFolderPath();
|
||||||
string GetAudioFolderPath ();
|
string GetAudioFolderPath();
|
||||||
string GetVideoFolderPath ();
|
string GetVideoFolderPath();
|
||||||
string GetDocumentFolderPath ();
|
string GetDocumentFolderPath();
|
||||||
string FilePathResolver (string fullPath);
|
string FilePathResolver(string fullPath);
|
||||||
|
string ConvertToFileUrl(string fullPath);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//
|
//
|
||||||
#region Prepare Storage Structure ...
|
#region Prepare Storage Structure ...
|
||||||
void Prepare ();
|
void Prepare();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//
|
//
|
||||||
#region Validators ...
|
#region Validators ...
|
||||||
bool IsFolderExists (string path);
|
bool IsFolderExists(string path);
|
||||||
bool IsFileExists (string filePath);
|
bool IsFileExists(string filePath);
|
||||||
bool IsSupportThumb (string fileName);
|
bool IsSupportThumb(string fileName);
|
||||||
bool IsSupportThumb (XFileType type);
|
bool IsSupportThumb(XFileType type);
|
||||||
void ValidateFileExists (string filePath);
|
void ValidateFileExists(string filePath);
|
||||||
void ValidateFileModel (XFileDto file);
|
void ValidateFileModel(XFileDto file);
|
||||||
void ValidateFile (IFormFile file);
|
void ValidateFile(IFormFile file);
|
||||||
void ValidateProfileImage (IFormFile file);
|
void ValidateProfileImage(IFormFile file);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//
|
//
|
||||||
#region Generators ...
|
#region Generators ...
|
||||||
string NewFileName ();
|
string NewFileName();
|
||||||
string GenerateThumbName (string fileName);
|
string GenerateThumbName(string fileName);
|
||||||
string GetNewFileName (string fileName);
|
string GetNewFileName(string fileName);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//
|
//
|
||||||
#region Tools Actions ...
|
#region Tools Actions ...
|
||||||
|
|
||||||
string GetFileExtension (string fileName);
|
string GetFileExtension(string fileName);
|
||||||
string GetFileNameWithoutExtension (string fileName);
|
string GetFileNameWithoutExtension(string fileName);
|
||||||
FileExtensions GetFileExtensionType (string fileName);
|
FileExtensions GetFileExtensionType(string fileName);
|
||||||
XFileType GetFileType (string fileName);
|
XFileType GetFileType(string fileName);
|
||||||
XFileType GetFileType (FileExtensions fileExtension);
|
XFileType GetFileType(FileExtensions fileExtension);
|
||||||
string GetThumbnailFileFullPath (string thumFileName);
|
string GetThumbnailFileFullPath(string thumFileName);
|
||||||
string GetRelatedThumbnailFullPath (string fileName);
|
string GetRelatedThumbnailFullPath(string fileName);
|
||||||
string GetFileTypeFolderPath (XFileType type);
|
string GetFileTypeFolderPath(XFileType type);
|
||||||
string GetFileFolderPath (
|
string GetFileFolderPath(
|
||||||
string fileName,
|
string fileName,
|
||||||
bool isTemp = false,
|
bool isTemp = false,
|
||||||
bool isWidget = false
|
bool isWidget = false
|
||||||
);
|
);
|
||||||
string GetFileFullPath (
|
string GetFileFullPath(
|
||||||
string fileName,
|
string fileName,
|
||||||
bool isTemp = false,
|
bool isTemp = false,
|
||||||
bool isWidget = false
|
bool isWidget = false
|
||||||
);
|
);
|
||||||
Task<string> SaveFileAsync (
|
Task<string> SaveFileAsync(
|
||||||
IFormFile file,
|
IFormFile file,
|
||||||
bool isTemp = false,
|
bool isTemp = false,
|
||||||
bool isWidget = false
|
bool isWidget = false,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
);
|
);
|
||||||
void DeleteFile (
|
void DeleteFile(
|
||||||
string fileFullPath,
|
string fileFullPath,
|
||||||
bool forceFileExists = true,
|
bool forceFileExists = true,
|
||||||
Exception exception = null
|
Exception exception = null
|
||||||
);
|
);
|
||||||
ICollection<string> DeleteFiles (
|
ICollection<string> DeleteFiles(
|
||||||
ICollection<string> fileFullPaths,
|
ICollection<string> fileFullPaths,
|
||||||
bool forceFileExists = true,
|
bool forceFileExists = true,
|
||||||
Exception exception = null
|
Exception exception = null
|
||||||
);
|
);
|
||||||
// Task CreateThumbnail (XFile file);
|
// Task CreateThumbnail (XFile file);
|
||||||
Task CreateThumbnail (XFileDto file);
|
Task CreateThumbnail(
|
||||||
Task CreateThumbnail (string fileName);
|
XFileDto file,
|
||||||
Task<XFileResult> HandleProfileImageSave (IFormFile file);
|
CancellationToken cancellationToken = default
|
||||||
Task<XFileResult> HandleFileSave (IFormFile file);
|
);
|
||||||
Task<IEnumerable<XFileResult>> HandleFilesSave (IFormFileCollection files);
|
Task CreateThumbnail(
|
||||||
|
string fileName,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
);
|
||||||
|
Task<XFileResult> HandleProfileImageSave(
|
||||||
|
IFormFile file,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
);
|
||||||
|
Task<XFileResult> HandleFileSave(
|
||||||
|
IFormFile file,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
);
|
||||||
|
Task<IEnumerable<XFileResult>> HandleFilesSave(
|
||||||
|
IFormFileCollection files,
|
||||||
|
CancellationToken cancellationToken = default
|
||||||
|
);
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+395
-253
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -1,7 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
|
<!-- <add key="megan" value="https://hub.megan.ir/nuget/index.json" /> -->
|
||||||
<add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
<add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
||||||
<add key="liget" value="https://nuget.saherelmhub.ir/v3/index.json" protocolVersion="3" />
|
<add key="baget" value="https://nuget.saherelmhub.ir/v3/index.json" protocolVersion="3" disableTLSCertificateValidation="true" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
</configuration>
|
</configuration>
|
||||||
+19
-6
@@ -2,11 +2,13 @@
|
|||||||
|
|
||||||
<!-- Runtime Definition -->
|
<!-- Runtime Definition -->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
|
||||||
<PackageId>xDashboard.xStorageService</PackageId>
|
|
||||||
<Version>1.0.0</Version>
|
<Version>1.0.0</Version>
|
||||||
|
<LangVersion>12.0</LangVersion>
|
||||||
<Authors>Hadi Khazaee Asl</Authors>
|
<Authors>Hadi Khazaee Asl</Authors>
|
||||||
<Company>SaherElm IT Center</Company>
|
<Company>SaherElm IT Center</Company>
|
||||||
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
|
<PackageId>xDashboard.xStorageService</PackageId>
|
||||||
|
|
||||||
<Description>
|
<Description>
|
||||||
provide File Storage/Validating/Handling and etc tools to xDashboard project.
|
provide File Storage/Validating/Handling and etc tools to xDashboard project.
|
||||||
</Description>
|
</Description>
|
||||||
@@ -17,19 +19,30 @@
|
|||||||
|
|
||||||
<!-- Icon Handling -->
|
<!-- Icon Handling -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="../../Resources/Images/favicon.png" Link="icon.png" Pack="true" PackagePath="\icon.png" />
|
<None Include="../../Resources/Images/favicon.png" Link="icon.png" Pack="true"
|
||||||
|
PackagePath="\icon.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- Local Modules -->
|
<!-- Local Modules -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xDashboard.xModels" Version="1.0.0" />
|
</ItemGroup>
|
||||||
<!-- <ProjectReference Include="../xModels/xModels.csproj" /> -->
|
|
||||||
|
<!-- Local Dependencies -->
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="../xModels/xModels.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- Dependencies -->
|
<!-- Dependencies -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="7.23.1" />
|
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="7.23.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="5.0.0" />
|
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="3.1.32.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<!-- For XML Documentation Support -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
|
<NoWarn>$(NoWarn);1591</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
Reference in New Issue
Block a user