private void GetGenerateProxyFileInfos(List <IFileInfo> fileInfoList, string path = "")
 {
     foreach (var directoryContent in VirtualFileProvider.GetDirectoryContents(path))
     {
         if (directoryContent.IsDirectory)
         {
             GetGenerateProxyFileInfos(fileInfoList, directoryContent.PhysicalPath);
         }
         else
         {
             if (directoryContent.Name.EndsWith("generate-proxy.json"))
             {
                 fileInfoList.Add(VirtualFileProvider.GetFileInfo(directoryContent.GetVirtualOrPhysicalPathOrNull()));
             }
         }
     }
 }
        protected virtual async Task <ILocalizedTemplateContentReader> CreateInternalAsync(
            TemplateDefinition templateDefinition)
        {
            var virtualPath = templateDefinition.GetVirtualFilePathOrNull();

            if (virtualPath == null)
            {
                return(NullLocalizedTemplateContentReader.Instance);
            }

            var fileInfo = VirtualFileProvider.GetFileInfo(virtualPath);

            if (!fileInfo.Exists)
            {
                var directoryContents = VirtualFileProvider.GetDirectoryContents(virtualPath);
                if (!directoryContents.Exists)
                {
                    throw new AbpException("Could not find a file/folder at the location: " + virtualPath);
                }

                fileInfo = new VirtualDirectoryFileInfo(virtualPath, virtualPath, DateTimeOffset.UtcNow);
            }

            if (fileInfo.IsDirectory)
            {
                //TODO: Configure file extensions.
                var folderReader = new VirtualFolderLocalizedTemplateContentReader(new[] { ".tpl", ".cshtml" });
                await folderReader.ReadContentsAsync(VirtualFileProvider, virtualPath);

                return(folderReader);
            }
            else //File
            {
                var singleFileReader = new FileInfoLocalizedTemplateContentReader();
                await singleFileReader.ReadContentsAsync(fileInfo);

                return(singleFileReader);
            }
        }