/// <summary> /// Parses the given <paramref name="fileName"/> into a <see cref="IResourcePath"/>. /// </summary> /// <param name="context"></param> /// <param name="resourceService"></param> /// <param name="fileName"></param> /// <returns></returns> private static IResourcePath ParsePath(IMansionContext context, IResourceService resourceService, string fileName) { // check if the filename starts with the application path if (fileName.StartsWith(HttpContext.Current.Request.ApplicationPath)) fileName = fileName.Substring(HttpContext.Current.Request.ApplicationPath.Length); // trim the file name fileName = fileName.Trim('/', '\\'); // create the properties var properties = new PropertyBag { {"path", fileName} }; // parse the path return resourceService.ParsePath(context, properties); }