private SyndicationFeed LoadFeed() { var atomFilePath = Path.Combine(_configuration.VsixStorageDirectory, "atom.xml"); var feed = AtomFeedHelper.LoadAtomFeed(atomFilePath); return(feed); }
private Response HandleJsonFeedRequest(dynamic parameters) { var atomFilePath = Path.Combine(Environment.CurrentDirectory, _configuration.Storage.VsixStorageDirectory, "atom.xml"); var feed = AtomFeedHelper.LoadAtomFeed(atomFilePath); // Return the feed or no content error if nothing is found return(feed == null ? new Response { StatusCode = HttpStatusCode.NoContent } : Response.AsText(JsonConvert.SerializeObject(feed), "application/json")); }
private SyndicationFeed CreateAtomFeed(string atomFeedFilePath, IEnumerable <IVsixPackage> packages) { var rootDirectory = new Uri(Path.GetDirectoryName(atomFeedFilePath) + "\\"); Directory.CreateDirectory(rootDirectory.AbsolutePath); var imageRoot = Path.Combine(rootDirectory.LocalPath, "VSIXData"); Directory.CreateDirectory(imageRoot); var feed = CreateNewFeed(); AddPackages(feed, rootDirectory, imageRoot, packages); AtomFeedHelper.WriteAtomFeed(atomFeedFilePath, feed); return(feed); }