All Downloads are FREE. Search and download functionalities are using the official Maven repository.

aQute.bnd.differ.RepositoryElement Maven / Gradle / Ivy

There is a newer version: 7.0.0
Show newest version
package aQute.bnd.differ;

import java.util.ArrayList;
import java.util.List;

import aQute.bnd.service.RepositoryPlugin;
import aQute.bnd.service.diff.Delta;
import aQute.bnd.service.diff.Type;
import aQute.bnd.version.Version;

public class RepositoryElement {

	public static Element getTree(RepositoryPlugin repo) throws Exception {
		List programs = new ArrayList();
		for (String bsn : repo.list(null)) {
			List versions = new ArrayList();
			for (Version version : repo.versions(bsn)) {
				versions.add(new Element(Type.VERSION, version.toString()));
			}
			programs.add(new Element(Type.PROGRAM, bsn, versions, Delta.MINOR, Delta.MAJOR, null));
		}
		return new Element(Type.REPO, repo.getName(), programs, Delta.MINOR, Delta.MAJOR, repo.getLocation());
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy