Fixed path normalization.

pull/179/head
Halil İbrahim Kalkan 7 years ago
parent 7f95e2810e
commit 63587a2fb5

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

@ -28,7 +28,7 @@ namespace Volo.Abp.VirtualFileSystem
private static string NormalizeChars(string fileName)
{
return fileName.Replace(".", "/").Replace("-", "_");
return fileName.Replace(".", "/");
}
}
}
Loading…
Cancel
Save