예제 #1
0
        private async Task <QueryResult <FileSystemMetadata> > FindFileMetadata(string path, string accessToken, CancellationToken cancellationToken)
        {
            var metadata = await _dropboxApi.Metadata(path, accessToken, cancellationToken);

            return(new QueryResult <FileSystemMetadata>
            {
                Items = new[] { CreateFileMetadata(metadata) },
                TotalRecordCount = 1
            });
        }
        private async Task <QueryResult <FileSystemMetadata> > FindFileMetadata(string path, string accessToken, CancellationToken cancellationToken)
        {
            try
            {
                var metadata = await _dropboxApi.Metadata(path, accessToken, cancellationToken, _logger);

                return(new QueryResult <FileSystemMetadata>
                {
                    Items = new[] { CreateFileMetadata(metadata) },
                    TotalRecordCount = 1
                });
            }
            catch (HttpException ex)
            {
                if (ex.StatusCode == HttpStatusCode.Conflict)
                {
                    _logger.Debug("No Data, maybe a 409");
                    return(new QueryResult <FileSystemMetadata>());
                }

                throw;
            }
        }