Example #1
0
        public URespose <bool> DeleteDirectory(string Owner, string path)
        {
            try
            {
                var(token, ownerToken) = StandartHeader(Owner, ref path);

                return(storageManager.DeleteDirectory(token, ownerToken, path));
            }
            catch
            {
                return(URespose.BadResponse());
            }
        }
Example #2
0
        public URespose <bool> IsExistFile(string Owner, string path)
        {
            try
            {
                var(token, ownerToken) = StandartHeader(Owner, ref path);

                return(storageManager.IsExistFile(token, ownerToken, path));
            }
            catch
            {
                return(URespose.BadResponse());
            }
        }
Example #3
0
        public URespose RemoveDocumentOverlay(string Owner, string path, int Page)
        {
            try
            {
                var(token, ownerToken) = StandartHeader(Owner, ref path);

                storageManager.SetDocumentOverlayContent(token, ownerToken, path, Page, null);
                return(URespose.GoodResponse());
            }
            catch
            {
                return(URespose.BadResponse());
            }
        }
Example #4
0
        public URespose SetDocumentOverlay(string Owner, string path, int Page, IFormFile Content)
        {
            try
            {
                var(token, ownerToken) = StandartHeader(Owner, ref path);

                using (var sm = Content.OpenReadStream())
                    storageManager.SetDocumentOverlayContent(token, ownerToken, path, Page, sm);

                return(URespose.GoodResponse());
            }
            catch
            {
                return(URespose.BadResponse());
            }
        }
Example #5
0
        public URespose LoadFile(string Owner, string path, IFormFile uploadedFile)
        {
            try
            {
                var(token, ownerToken) = StandartHeader(Owner, ref path);

                if (storageManager.CreateFile(token, ownerToken, path, uploadedFile.OpenReadStream()))
                {
                    return(URespose.GoodResponse());
                }
                return(URespose.BadResponse());
            }
            catch
            {
                return(URespose.BadResponse());
            }
        }
Example #6
0
        public UCustomRespose <FileStreamResult> GetDocumentOverlay(string Owner, string path, int Page)
        {
            try
            {
                var(token, ownerToken) = StandartHeader(Owner, ref path);

                var stream = storageManager.GetDocumentOverlayContent(token, ownerToken, path, Page);

                if (stream == null)
                {
                    return(URespose.BadResponse());
                }

                var fResult = File(stream, "application/octet-stream");
                return(UCustomRespose <FileStreamResult> .Create(fResult));
            }
            catch
            {
                return(URespose.BadResponse());
            }
        }
Example #7
0
        public URespose <DirectoryContent> DirectoryContent(string Owner, string path)
        {
            try
            {
                var(token, ownerToken) = StandartHeader(Owner, ref path);

                var directoryDescription = storageManager
                                           .GetDirectoryInfo(token, ownerToken, path ?? "");

                var content = new DirectoryContent
                {
                    Files       = directoryDescription.Files.ToList(),
                    Documents   = directoryDescription.Documents.ToList(),
                    Directories = directoryDescription.Directories.ToList()
                };

                return(content);
            }
            catch
            {
                return(URespose.BadResponse());
            }
        }