public Feed getReleaseFeed(String repositoryName, String baseUrl, int maxFeedEntries) throws IOException {
        Feed feed = new Feed();
        feed.setFeedType("atom_1.0");
        
        Person author = new Person();
        author.setName("BattleScribe Data");
        author.setUrl(baseUrl.replace("/" + WebConstants.REPO_SERVICE_PATH, ""));
        feed.setAuthors(Collections.singletonList(author));
        
        String organizationName = ApplicationProperties.getProperties().getProperty(PropertiesConstants.GITHUB_ORGANIZATION);
        List<Entry> entries;
        if (repositoryName.toLowerCase().equals(WebConstants.ALL_REPO_FEEDS)) {
            String feedUrl = Utils.checkUrl(baseUrl + "/feeds/" + WebConstants.ALL_REPO_FEEDS + ".atom");
            
            feed.setId(feedUrl);
            feed.setTitle("All Repository Releases");
            
            Link link = new Link();
            link.setType(DataConstants.HTML_MIME_TYPE);
            link.setHref(getHtmlLink(baseUrl, WebConstants.ALL_REPO_FEEDS));
            feed.setAlternateLinks(Collections.singletonList(link));
            
            Link selfLink = new Link();
            selfLink.setRel("self");
            selfLink.setHref(feedUrl);
            feed.setOtherLinks(Collections.singletonList(selfLink));
            
            Content description = new Content();
            description.setType(DataConstants.TEXT_MIME_TYPE);
            description.setValue("Data file releases for all repositories");
            feed.setSubtitle(description);
            
            List<Repository> repositories = getRepositories(organizationName);
            maxFeedEntries /= repositories.size();
            if (maxFeedEntries < 1) {
                maxFeedEntries = 1;
            }
            
            entries = new ArrayList<>();
            for (Repository repository : repositories) {
                entries.addAll(getReleaseFeedEntries(baseUrl, repository, maxFeedEntries));
            }
        }
        else {
            Repository repository = getRepository(organizationName, repositoryName);
            String feedUrl = Utils.checkUrl(baseUrl + "/feeds/" + repositoryName + ".atom");
            
            feed.setId(feedUrl);
            feed.setTitle(repository.getDescription() + " Releases");
            
            Link link = new Link();
            link.setType(DataConstants.HTML_MIME_TYPE);
            link.setHref(getHtmlLink(baseUrl, repositoryName));
            feed.setAlternateLinks(Collections.singletonList(link));
            
            Link selfLink = new Link();
            selfLink.setRel("self");
            selfLink.setHref(feedUrl);
            feed.setOtherLinks(Collections.singletonList(selfLink));
            
            Content description = new Content();
            description.setType(DataConstants.TEXT_MIME_TYPE);
            description.setValue("Data file releases for " + repository.getDescription());
            feed.setSubtitle(description);
            
            entries = getReleaseFeedEntries(baseUrl, repository, maxFeedEntries);
        }
        
        Collections.sort(entries, new Comparator<Entry>() {
            @Override
            public int compare(Entry o1, Entry o2) {
                return o2.getPublished().compareTo(o1.getPublished());
            }
        });
        
        if (!entries.isEmpty()) {
            feed.setUpdated(entries.get(0).getPublished());
        }
        else {
            feed.setUpdated(new Date());
        }
        feed.setEntries(entries);
        return feed;
    }