getting some interface to fs
This commit is contained in:
parent
f04a316860
commit
77128e1a7e
11 changed files with 144 additions and 36 deletions
24
src/Yavsc/Controllers/FileSystemController.cs
Normal file
24
src/Yavsc/Controllers/FileSystemController.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Yavsc.Helpers;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
public class FileSystemController : Controller
|
||||
{
|
||||
ILogger _logger;
|
||||
public FileSystemController(ILoggerFactory loggerFactory)
|
||||
{
|
||||
_logger = loggerFactory.CreateLogger<FileSystemController>();
|
||||
}
|
||||
|
||||
public IActionResult Index(string subdir="")
|
||||
{
|
||||
if (subdir !=null)
|
||||
if (!subdir.IsValidYavscPath())
|
||||
return new BadRequestResult();
|
||||
var files = AbstractFileSystemHelpers.GetUserFiles(User.Identity.Name, subdir);
|
||||
return View(files);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue