From 63587a2fb5337fa6a92658cc8d60cb5c076fa49d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 3 Nov 2017 10:16:45 +0300 Subject: [PATCH] Fixed path normalization. --- .../Abp/VirtualFileSystem/Embedded/EmbeddedFileSet.cs | 8 +------- .../Volo/Abp/VirtualFileSystem/EmbeddedFilePathHelper.cs | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/Embedded/EmbeddedFileSet.cs b/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/Embedded/EmbeddedFileSet.cs index e4e638e125..361fd63e44 100644 --- a/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/Embedded/EmbeddedFileSet.cs +++ b/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/Embedded/EmbeddedFileSet.cs @@ -104,18 +104,12 @@ namespace Volo.Abp.VirtualFileSystem.Embedded return resourceName; } - var folder = pathParts.Take(pathParts.Length - 2).Select(NormalizeFolderName).JoinAsString("/"); + var folder = pathParts.Take(pathParts.Length - 2).JoinAsString("/"); var fileName = pathParts[pathParts.Length - 2] + "." + pathParts[pathParts.Length - 1]; return folder + "/" + fileName; } - private static string NormalizeFolderName(string pathPart) - { - //TODO: Implement all rules of .NET - return pathPart.Replace('-', '_'); - } - private static string CalculateFileName(string filePath) { if (!filePath.Contains("/")) diff --git a/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/EmbeddedFilePathHelper.cs b/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/EmbeddedFilePathHelper.cs index 0803d9a321..a184e61346 100644 --- a/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/EmbeddedFilePathHelper.cs +++ b/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/EmbeddedFilePathHelper.cs @@ -28,7 +28,7 @@ namespace Volo.Abp.VirtualFileSystem private static string NormalizeChars(string fileName) { - return fileName.Replace(".", "/").Replace("-", "_"); + return fileName.Replace(".", "/"); } } } \ No newline at end of file