use of org.eclipse.equinox.p2.repository.IRepositoryReference in project tycho by eclipse.
the class MetadataSerializableImpl method serialize.
@Override
public void serialize(OutputStream stream, Set<?> installableUnits) throws IOException {
final List<IInstallableUnit> units = toInstallableUnits(installableUnits);
// TODO check if we can really "reuse" LocalMetadataRepository or should we implement our own Repository
AbstractMetadataRepository targetRepo = new AbstractMetadataRepository(agent, // $NON-NLS-1$
"TychoTargetPlatform", // $NON-NLS-1$
LocalMetadataRepository.class.getName(), // $NON-NLS-1$
"0.0.1", // $NON-NLS-1$
null, // $NON-NLS-1$
null, // $NON-NLS-1$
null, // $NON-NLS-1$
null) {
@Override
public void initialize(RepositoryState state) {
}
@Override
public Collection<IRepositoryReference> getReferences() {
return Collections.emptyList();
}
@Override
public IQueryResult<IInstallableUnit> query(IQuery<IInstallableUnit> query, IProgressMonitor monitor) {
return query.perform(units.iterator());
}
};
new MetadataRepositoryIO(agent).write(targetRepo, stream);
}
Aggregations