Esempio n. 1
0
        public string FullPath(string templatePath)
        {
            if (templatePath == null || !Regex.IsMatch(templatePath, @"^[^.\/][a-zA-Z0-9_\/]+$"))
            {
                throw new FileSystemException(
                          Liquid.ResourceManager.GetString("LocalFileSystemIllegalTemplateNameException"), templatePath);
            }

            var basePath = templatePath.Contains("/")
                ? Path.Combine(Root, Path.GetDirectoryName(templatePath))
                : Root;

            var fileName = string.Format("_{0}.liquid", Path.GetFileName(templatePath));

            var fullPath = MyRegex.Replace(Path.Combine(basePath, fileName), @"\\|/", ".");

            return(fullPath);
        }