private List<RepositoryInfo> getRepository(File repositoryFile, StackInfo stack,
List<LatestRepoCallable> lookupList)
throws JAXBException {
RepositoryXml rxml = StackExtensionHelper.unmarshal(RepositoryXml.class, repositoryFile);
List<RepositoryInfo> list = new ArrayList<RepositoryInfo>();
for (Os o : rxml.getOses()) {
for (String os : o.getType().split(",")) {
for (Repo r : o.getRepos()) {
RepositoryInfo ri = new RepositoryInfo();
ri.setBaseUrl(r.getBaseUrl());
ri.setDefaultBaseUrl(r.getBaseUrl());
ri.setMirrorsList(r.getMirrorsList());
ri.setOsType(os.trim());
ri.setRepoId(r.getRepoId());
ri.setRepoName(r.getRepoName());
ri.setLatestBaseUrl(r.getBaseUrl());
if (null != metainfoDAO) {
LOG.debug("Checking for override for base_url");
String key = generateRepoMetaKey(r.getRepoName(), stack.getVersion(),
o.getType(), r.getRepoId(), REPOSITORY_XML_PROPERTY_BASEURL);
MetainfoEntity entity = metainfoDAO.findByKey(key);
if (null != entity) {
ri.setBaseUrl(entity.getMetainfoValue());
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("Adding repo to stack"
+ ", repoInfo=" + ri.toString());
}
list.add(ri);
}
}
}
if (null != rxml.getLatestURI() && list.size() > 0) {
lookupList.add(new LatestRepoCallable(rxml.getLatestURI(),
repositoryFile.getParentFile(), stack));
}
return list;