public async Task<bool> FileExistsAsync(GitHubRepoSearchItem repo, string filePath) { var wc = new WebClient(); var url = $"https://raw.githubusercontent.com/{repo.FullName}/master/{filePath}"; try { var json = await wc.DownloadDataTaskAsync(url); return true; } catch (WebException) { return false; } }
public Task<GitHubRepoSearchItem> GetDescription(string owner, string name) { string description; if (Descriptions.TryGetValue(Tuple.Create(owner, name), out description)) { var item = new GitHubRepoSearchItem(); item.Description = description; return Task.FromResult(item); } throw new WebException(); }
public async Task <bool> FileExistsAsync(GitHubRepoSearchItem repo, string filePath) { var wc = new WebClient(); var url = Invariant($"https://raw.githubusercontent.com/{repo.FullName}/master/{filePath}"); try { var json = await wc.DownloadDataTaskAsync(url); return(true); } catch (WebException) { return(false); } }
public Task<bool> FileExistsAsync(GitHubRepoSearchItem repo, string filePath) { throw new NotImplementedException(); }