Beispiel #1
0
        public ActionResult <ApiDirectory> Get(string relativePathToDirectory)
        {
            if (string.IsNullOrEmpty(relativePathToDirectory))
            {
                relativePathToDirectory = "";
            }

            relativePathToDirectory = WebUtility.UrlDecode(relativePathToDirectory);

            var directoryInfo = _fileProvider.GetDirectoryContents(relativePathToDirectory);

            if (!directoryInfo.Exists)
            {
                return(NotFound(new ApiError("The directory requested does not exist")));
            }

            return(FileLogic.GetDirectoryInfo(directoryInfo, relativePathToDirectory));
        }