FileUtils.deleteDirectory(artifactRepositoryDir);
artifactMappingsXmlFile.delete();
}
}
catch (final XmlPullParserException e) {
throw new RemoteStorageException(e);
}
catch (final UnsupportedStorageOperationException e) {
throw new RemoteStorageException(e);
}
catch (final URISyntaxException e) {
throw new RemoteStorageException(e);
}
catch (final IOException e) {
throw new RemoteStorageException(e);
}
final Artifacts metadata = new Artifacts(dom);
metadata.setRepositoryAttributes(repository.getName());
final LinkedHashMap<String, String> properties = metadata.getProperties();
final String mirrorsURL = properties.get(P2Constants.PROP_MIRRORS_URL);
if (mirrorsURL != null) {
context.put(CTX_MIRRORS_URL, mirrorsURL);
}
properties.remove(P2Constants.PROP_MIRRORS_URL);
metadata.setProperties(properties);
try {
return createMetadataItems(
repository,
P2Constants.ARTIFACTS_XML,
P2Constants.ARTIFACTS_JAR,
metadata,
P2Constants.XMLPI_ARTIFACTS,
context
);
}
catch (IOException e) {
throw new RemoteStorageException(e);
}
}