Browse Source

Fixed path normalization.

pull/179/head
Halil İbrahim Kalkan 9 years ago
parent
commit
63587a2fb5
  1. 8
      src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/Embedded/EmbeddedFileSet.cs
  2. 2
      src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/EmbeddedFilePathHelper.cs

8
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("/"))

2
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(".", "/");
}
}
}
Loading…
Cancel
Save