aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-cli/src/main/java
diff options
context:
space:
mode:
authorJesse McConnell <jmcconnell@apache.org>2007-04-12 22:00:28 +0000
committerJesse McConnell <jmcconnell@apache.org>2007-04-12 22:00:28 +0000
commite970003cf5b624784bb2fbfebe259da3aa01574e (patch)
treefaeea0fe2e7418440d32624c1cd923d11b322206 /archiva-cli/src/main/java
parent4a0241c5919acd3fb80076f42d6f77947bc2a5d5 (diff)
downloadarchiva-e970003cf5b624784bb2fbfebe259da3aa01574e.tar.gz
archiva-e970003cf5b624784bb2fbfebe259da3aa01574e.zip
working on getting the cli working again
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches/archiva-jpox-database-refactor@528251 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-cli/src/main/java')
-rw-r--r--archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java b/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java
index 903593443..ae4e87826 100644
--- a/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java
+++ b/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java
@@ -24,6 +24,7 @@ import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.lang.StringUtils;
import org.apache.maven.archiva.common.utils.DateUtil;
+import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.consumers.ConsumerException;
import org.apache.maven.archiva.consumers.RepositoryContentConsumer;
import org.apache.maven.archiva.converter.RepositoryConversionException;
@@ -69,6 +70,8 @@ public class ArchivaCli
public static final char CONSUMERS = 'u';
public static final char LIST_CONSUMERS = 'l';
+
+ public static final char DUMP_CONFIGURATION = 'd';
// ----------------------------------------------------------------------------
// Properties controlling Repository conversion
@@ -80,6 +83,13 @@ public class ArchivaCli
public static final String BLACKLISTED_PATTERNS = "blacklistPatterns";
+ /**
+ * Configuration store.
+ *
+ * @plexus.requirement
+ */
+ private ArchivaConfiguration archivaConfiguration;
+
public static void main( String[] args )
throws Exception
{
@@ -122,6 +132,9 @@ public class ArchivaCli
Option listConsumersOption = createOption( LIST_CONSUMERS, "listconsumers", 0, "List available consumers." );
options.addOption( listConsumersOption );
+ Option dumpConfig = createOption( DUMP_CONFIGURATION, "dumpconfig", 0, "Dump Current Configuration." );
+ options.addOption( dumpConfig );
+
return options;
}
@@ -140,6 +153,10 @@ public class ArchivaCli
{
dumpAvailableConsumers( plexus );
}
+ else if ( cli.hasOption( DUMP_CONFIGURATION ) )
+ {
+ dumpConfiguration( plexus );
+ }
else
{
displayHelp();
@@ -279,4 +296,11 @@ public class ArchivaCli
showFatalError( "Error converting repository.", e, true );
}
}
+
+ private void dumpConfiguration( PlexusContainer plexus ) throws ComponentLookupException
+ {
+ archivaConfiguration = (ArchivaConfiguration) plexus.lookup( ArchivaConfiguration.ROLE );
+
+ System.out.println( "File Type Count: " + archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().size() );
+ }
}