Search in sources :

Example 1 with LegacyArtifactPath

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);
}
Also used : LegacyArtifactPath(org.apache.archiva.admin.model.beans.LegacyArtifactPath) UiConfiguration(org.apache.archiva.admin.model.beans.UiConfiguration) NetworkConfiguration(org.apache.archiva.admin.model.beans.NetworkConfiguration) Configuration(org.apache.archiva.configuration.Configuration) WebappConfiguration(org.apache.archiva.configuration.WebappConfiguration)

Example 2 with LegacyArtifactPath

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);
}
Also used : LegacyArtifactPath(org.apache.archiva.admin.model.beans.LegacyArtifactPath) UiConfiguration(org.apache.archiva.admin.model.beans.UiConfiguration) NetworkConfiguration(org.apache.archiva.admin.model.beans.NetworkConfiguration) Configuration(org.apache.archiva.configuration.Configuration) WebappConfiguration(org.apache.archiva.configuration.WebappConfiguration)

Example 3 with LegacyArtifactPath

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();
}
Also used : LegacyArtifactPath(org.apache.archiva.admin.model.beans.LegacyArtifactPath)

Aggregations

LegacyArtifactPath (org.apache.archiva.admin.model.beans.LegacyArtifactPath)3 NetworkConfiguration (org.apache.archiva.admin.model.beans.NetworkConfiguration)2 UiConfiguration (org.apache.archiva.admin.model.beans.UiConfiguration)2 Configuration (org.apache.archiva.configuration.Configuration)2 WebappConfiguration (org.apache.archiva.configuration.WebappConfiguration)2