From 2f131c666ad40f02ba617abe3f8b4490e3bfc45f Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Wed, 1 Nov 2017 15:36:28 +0100 Subject: [PATCH] Adapting cli to the new repository api --- .../apache/archiva/cli/AbstractProgressConsumer.java | 2 +- .../main/java/org/apache/archiva/cli/ArchivaCli.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/archiva-cli/src/main/java/org/apache/archiva/cli/AbstractProgressConsumer.java b/archiva-cli/src/main/java/org/apache/archiva/cli/AbstractProgressConsumer.java index c415face4..be552a330 100644 --- a/archiva-cli/src/main/java/org/apache/archiva/cli/AbstractProgressConsumer.java +++ b/archiva-cli/src/main/java/org/apache/archiva/cli/AbstractProgressConsumer.java @@ -19,10 +19,10 @@ package org.apache.archiva.cli; * under the License. */ -import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.consumers.AbstractMonitoredConsumer; import org.apache.archiva.consumers.ConsumerException; import org.apache.archiva.consumers.RepositoryContentConsumer; +import org.apache.archiva.repository.ManagedRepository; import java.util.Date; diff --git a/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java b/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java index dad00f651..d274c3db3 100644 --- a/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java +++ b/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java @@ -21,13 +21,14 @@ package org.apache.archiva.cli; import com.sampullara.cli.Args; import com.sampullara.cli.Argument; -import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.consumers.ConsumerException; import org.apache.archiva.consumers.InvalidRepositoryContentConsumer; import org.apache.archiva.consumers.KnownRepositoryContentConsumer; import org.apache.archiva.consumers.RepositoryContentConsumer; import org.apache.archiva.converter.RepositoryConversionException; import org.apache.archiva.converter.legacy.LegacyRepositoryConverter; +import org.apache.archiva.repository.BasicManagedRepository; +import org.apache.archiva.repository.ManagedRepository; import org.apache.archiva.repository.scanner.RepositoryScanStatistics; import org.apache.archiva.repository.scanner.RepositoryScanner; import org.apache.archiva.repository.scanner.RepositoryScannerException; @@ -47,6 +48,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Properties; @@ -166,10 +168,8 @@ public class ArchivaCli private void doScan( String path, String[] consumers ) throws ConsumerException, MalformedURLException { - ManagedRepository repo = new ManagedRepository(); - repo.setId( Paths.get( path ).getFileName().toString()); - repo.setName( "Archiva CLI Provided Repo" ); - repo.setLocation( path ); + BasicManagedRepository repo = new BasicManagedRepository( Paths.get(path).getFileName().toString(), "Archiva CLI Provided Repo" ); + repo.setLocation( Paths.get(path).toUri() ); List knownConsumerList = new ArrayList<>(); -- 2.39.5