sonarr-repo-only/NzbDrone.Api/Frontend/StaticResourceMapper.cs

21 lines
485 B
C#
Raw Normal View History

using System.IO;
namespace NzbDrone.Api.Frontend
{
public interface IMapHttpRequestsToDisk
{
string Map(string resourceUrl);
}
public class StaticResourceMapper : IMapHttpRequestsToDisk
{
public string Map(string resourceUrl)
{
var path = resourceUrl.Replace('/', Path.DirectorySeparatorChar);
path = path.Trim(Path.DirectorySeparatorChar).ToLower();
2013-05-03 05:42:18 +00:00
return Path.Combine("ui", path);
}
}
}