public ActionResult Show(string repository, string tree, string path)
        {
            var browser = new RepositoryBrowser(Path.Combine(UserConfigurationManager.Repositories, repository));

            var leaf = browser.GetLeaf(tree, path);
            if (leaf != null)
            {
                return new FileStreamResult(new MemoryStream(leaf.RawData), FileDisplayHandler.GetMimeType(Path.GetFileName(path)));
            }
            return null;
        }
예제 #2
0
 public ActionResult Show(string repository, string tree, string path)
 {
     using (var browser = new RepositoryBrowser(Path.Combine(UserConfigurationManager.Repositories, repository)))
     {
         var leaf = browser.GetLeaf(tree, path);
         if (leaf != null)
         {
             return(new FileStreamResult(new MemoryStream(leaf.RawData), FileDisplayHandler.GetMimeType(Path.GetFileName(path))));
         }
     }
     return(null);
 }