]> source.dussan.org Git - archiva.git/commitdiff
Adapting cli to the new repository api
authorMartin Stockhammer <martin_s@apache.org>
Wed, 1 Nov 2017 14:36:28 +0000 (15:36 +0100)
committerMartin Stockhammer <martin_s@apache.org>
Wed, 1 Nov 2017 14:36:28 +0000 (15:36 +0100)
archiva-cli/src/main/java/org/apache/archiva/cli/AbstractProgressConsumer.java
archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java

index c415face4730686896f771c5b89abf8de9177504..be552a330ee9f04bd9cb313a47129e845e13801d 100644 (file)
@@ -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;
 
index dad00f651b31fd33a7c7dfc1fd75b20597edc7eb..d274c3db32b53bc7e804117f8ddd27278393d9f8 100644 (file)
@@ -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<KnownRepositoryContentConsumer> knownConsumerList = new ArrayList<>();