use of org.eclipse.tycho.p2.maven.repository.xmlio.MetadataIO in project tycho by eclipse.
the class ModuleMetadataRepository method load.
private void load() throws ProvisionException {
try {
MetadataIO io = new MetadataIO();
FileInputStream is = new FileInputStream(storage);
units.addAll(io.readXML(is));
} catch (IOException e) {
String message = "I/O error while reading repository from " + storage;
int code = ProvisionException.REPOSITORY_FAILED_READ;
Status status = new Status(IStatus.ERROR, BUNDLE_ID, code, message, e);
throw new ProvisionException(status);
}
}
use of org.eclipse.tycho.p2.maven.repository.xmlio.MetadataIO in project tycho by eclipse.
the class ResolverDebugUtils method toDebugString.
public static String toDebugString(Collection<IInstallableUnit> ius, boolean verbose) {
if (ius == null || ius.isEmpty()) {
return "<empty>";
}
StringBuilder sb = new StringBuilder();
if (verbose) {
try {
ByteArrayOutputStream os = new ByteArrayOutputStream();
try {
new MetadataIO().writeXML(new LinkedHashSet<>(ius), os);
} finally {
os.close();
}
sb.append(os.toString("UTF-8"));
} catch (IOException e) {
throw new RuntimeException(e);
}
} else {
for (IInstallableUnit iu : ius) {
sb.append(" ").append(iu.toString()).append("\n");
}
}
return sb.toString();
}
Aggregations