public ResultData<FileListResult> Info(string path, FileDetailsType? additional = null)
        {
            var additionalParams = new[] {
                new QueryStringParameter("path", path),
                new QueryStringParameter("additional", additional)
            };

            return GetData<FileListResult>(new SynologyRequestParameters
            {
                Additional = additionalParams
            });
        }
        public ResultData<FileListResult> List(string folderPath, string pattern = null, FileType fileType = FileType.All, string gotoPath = null, FileDetailsType? additional = null, int offset = 0, int limit = 0, FileSortType sortBy = FileSortType.Name, ListSortDirection sortDirection = ListSortDirection.Ascending)
        {
            var additionalParams = new[] {
                new QueryStringParameter("additional", additional),
                new QueryStringParameter("folder_path", folderPath),
                new QueryStringParameter("offset", offset),
                new QueryStringParameter("pattern", pattern),
                new QueryStringParameter("filetype", fileType),
                new QueryStringParameter("goto_path", gotoPath),
                new QueryStringParameter("limit", limit),
                new QueryStringParameter("sort_by", sortBy),
                new QueryStringParameter("sort_direction", sortDirection)
            };

            return GetData<FileListResult>(new SynologyRequestParameters
            {
                Additional = additionalParams
            });
        }
Beispiel #3
0
        public IFileDetailsTarget GetDetailsTargetByType(FileDetailsType fileDetailsType)
        {
            var fileDetails = new FileDetails();

            switch (fileDetailsType)
            {
            case FileDetailsType.Version:
                return(new FileVersionDetailsAdapter(fileDetails));

            case FileDetailsType.Size:
                return(new FileSizeDetailsAdapter(fileDetails));

            default:
                var exception = new ArgumentException($"Invalid FileDetailsType supplied: '{fileDetailsType}'");
                var logger    = DependencyInjectionConfiguration.Container.GetInstance <ILogger>();
                logger.LogException(exception);

                throw exception;
            }
        }