use of org.apache.archiva.admin.model.beans.LegacyArtifactPath in project archiva by apache.
the class DefaultArchivaAdministration method deleteLegacyArtifactPath.
@Override
public void deleteLegacyArtifactPath(String path, AuditInformation auditInformation) throws RepositoryAdminException {
Configuration configuration = getArchivaConfiguration().getConfiguration();
org.apache.archiva.configuration.LegacyArtifactPath legacyArtifactPath = new org.apache.archiva.configuration.LegacyArtifactPath();
legacyArtifactPath.setPath(path);
configuration.removeLegacyArtifactPath(legacyArtifactPath);
saveConfiguration(configuration);
triggerAuditEvent("", "", AuditEvent.REMOVE_LEGACY_PATH, auditInformation);
}
use of org.apache.archiva.admin.model.beans.LegacyArtifactPath in project archiva by apache.
the class DefaultArchivaAdministration method addLegacyArtifactPath.
@Override
public void addLegacyArtifactPath(LegacyArtifactPath legacyArtifactPath, AuditInformation auditInformation) throws RepositoryAdminException {
Configuration configuration = getArchivaConfiguration().getConfiguration();
configuration.addLegacyArtifactPath(getModelMapper().map(legacyArtifactPath, org.apache.archiva.configuration.LegacyArtifactPath.class));
saveConfiguration(configuration);
triggerAuditEvent("", "", AuditEvent.ADD_LEGACY_PATH, auditInformation);
}
use of org.apache.archiva.admin.model.beans.LegacyArtifactPath in project archiva by apache.
the class ArchivaAdministrationTest method addAndDeleteLegacyPath.
public void addAndDeleteLegacyPath() throws Exception {
int initialSize = archivaAdministration.getLegacyArtifactPaths().size();
LegacyArtifactPath legacyArtifactPath = new LegacyArtifactPath("foo", "bar");
archivaAdministration.addLegacyArtifactPath(legacyArtifactPath, getFakeAuditInformation());
assertTrue(archivaAdministration.getLegacyArtifactPaths().contains(new LegacyArtifactPath("foo", "bar")));
assertEquals(initialSize + 1, archivaAdministration.getLegacyArtifactPaths().size());
archivaAdministration.deleteLegacyArtifactPath(legacyArtifactPath.getPath(), getFakeAuditInformation());
assertFalse(archivaAdministration.getLegacyArtifactPaths().contains(new LegacyArtifactPath("foo", "bar")));
assertEquals(initialSize, archivaAdministration.getLegacyArtifactPaths().size());
mockAuditListener.clearEvents();
}
Aggregations