Author: joakime
Date: Wed Apr 25 11:07:06 2007
New Revision: 532431

URL: http://svn.apache.org/viewvc?view=rev&rev=532431
Log:
* Ensure configuration file exists.
* Ensure configuration is synched with database.
* Fix application.xml for new Configuration load-on-starts.


Added:
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationUpgrade.java
   (with props)
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/ArchivaTaskQueue.java
   (with props)
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java
   (with props)
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/Banner.java
   (with props)
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ConfigurationSynchronization.java
   (with props)
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/startup/
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/startup/BannerTest.java
   (with props)
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/test/resources/banner.gz
   (with props)
Removed:
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/src/main/resources/META-INF/plexus/components.xml
Modified:
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/pom.xml
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/resources/org/apache/maven/archiva/configuration/default-archiva.xml
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ArchivaConfigurationAdaptor.java
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/pom.xml
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/DefaultArchivaTaskScheduler.java
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/check/RoleExistanceEnvironmentCheck.java
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/resources/META-INF/plexus/application.xml
    
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/resources/log4j.xml

Modified: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/pom.xml?view=diff&rev=532431&r1=532430&r2=532431
==============================================================================
--- 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/pom.xml
 (original)
+++ 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/pom.xml
 Wed Apr 25 11:07:06 2007
@@ -35,12 +35,21 @@
     </dependency>
     <dependency>
       <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-xml-tools</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
       <artifactId>archiva-policies</artifactId>
       <version>1.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-component-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>

Added: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationUpgrade.java
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationUpgrade.java?view=auto&rev=532431
==============================================================================
--- 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationUpgrade.java
 (added)
+++ 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationUpgrade.java
 Wed Apr 25 11:07:06 2007
@@ -0,0 +1,150 @@
+package org.apache.maven.archiva.configuration;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.math.NumberUtils;
+import org.apache.maven.archiva.xml.XMLException;
+import org.apache.maven.archiva.xml.XMLReader;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import 
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+/**
+ * A component that is first in the plexus startup that ensure that the 
configuration
+ * file format has been upgraded properly. 
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Joakim Erdfelt</a>
+ * @version $Id$
+ * 
+ * @plexus.component 
role="org.apache.maven.archiva.configuration.ConfigurationUpgrade"
+ *                   role-hint="default"
+ */
+public class ConfigurationUpgrade
+    extends AbstractLogEnabled
+    implements Initializable
+{
+    public static final int CURRENT_CONFIG_VERSION = 1;
+
+    /* NOTE: This component should *NOT USE* the configuration api to do it's 
upgrade */
+
+    public void initialize()
+        throws InitializationException
+    {
+        File userConfigFile = new File( System.getProperty( "user.home" ), 
".m2/archiva.xml" );
+
+        if ( !userConfigFile.exists() )
+        {
+            writeDefaultConfigFile( userConfigFile );
+            return;
+        }
+
+        boolean configOk = false;
+        try
+        {
+            XMLReader xml = new XMLReader( "configuration", userConfigFile );
+            String configVersion = xml.getElementText( 
"//configuration/version" );
+            if ( StringUtils.isNotBlank( configVersion ) )
+            {
+                configOk = true;
+
+                // Found an embedded configuration version.
+                int version = NumberUtils.toInt( configVersion, 0 );
+                if ( version < CURRENT_CONFIG_VERSION )
+                {
+                    upgradeVersion( userConfigFile, xml );
+                }
+            }
+        }
+        catch ( XMLException e )
+        {
+            getLogger().warn( "Unable to read user configuration XML: " + 
e.getMessage(), e );
+        }
+
+        if ( !configOk )
+        {
+            try
+            {
+                FileUtils.copyFile( userConfigFile, new File( 
userConfigFile.getAbsolutePath() + ".bak" ) );
+                writeDefaultConfigFile( userConfigFile );
+            }
+            catch ( IOException e )
+            {
+                getLogger().warn( "Unable to create backup of your 
configuration file: "
+                    + e.getMessage(), e );
+            }
+        }
+
+    }
+
+    private void upgradeVersion( File userConfigFile, XMLReader xml )
+    {
+        // TODO: write implementation when we have a current version greater 
than 1.
+    }
+
+    private void writeDefaultConfigFile( File userConfigFile )
+    {
+        URL defaultConfigURL = this.getClass()
+            .getResource( 
"/org/apache/maven/archiva/configuration/default-archiva.xml" );
+
+        if ( defaultConfigURL == null )
+        {
+            try
+            {
+                FileWriter writer = new FileWriter( userConfigFile );
+                writer.write( "<?xml version=\"1.0\"?>\n" );
+                writer.write( "<configuration />" );
+                writer.flush();
+                writer.close();
+                return;
+            }
+            catch ( IOException e )
+            {
+                getLogger().warn( "Unable to write default (generic) 
configuration file: "
+                    + e.getMessage(), e );
+            }
+        }
+
+        // Write default to user config file location.
+        try
+        {
+            FileOutputStream output = new FileOutputStream( userConfigFile );
+            InputStream input = defaultConfigURL.openStream();
+            IOUtils.copy( input, output );
+            output.flush();
+            input.close();
+            output.close();
+        }
+        catch ( IOException e )
+        {
+            getLogger().warn( "Unable to write default configuration file: " + 
e.getMessage(), e );
+        }
+    }
+
+}

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationUpgrade.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationUpgrade.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationUpgrade.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo?view=diff&rev=532431&r1=532430&r2=532431
==============================================================================
--- 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
 (original)
+++ 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
 Wed Apr 25 11:07:06 2007
@@ -33,7 +33,14 @@
     <class rootElement="true" xml.tagName="configuration">
       <name>Configuration</name>
       <version>1.0.0+</version>
-      <fields>
+      <fields>
+        <field>
+          <name>version</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+          <required>true</required>
+          <description>This is the version of the configuration 
format.</description>
+        </field>
         <field>
           <name>repositories</name>
           <version>1.0.0+</version>

Modified: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/resources/org/apache/maven/archiva/configuration/default-archiva.xml
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/resources/org/apache/maven/archiva/configuration/default-archiva.xml?view=diff&rev=532431&r1=532430&r2=532431
==============================================================================
--- 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/resources/org/apache/maven/archiva/configuration/default-archiva.xml
 (original)
+++ 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-configuration/src/main/resources/org/apache/maven/archiva/configuration/default-archiva.xml
 Wed Apr 25 11:07:06 2007
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
+  <version>1</version>
   <repositories>
     <repository>
       <id>internal</id>

Modified: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ArchivaConfigurationAdaptor.java
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ArchivaConfigurationAdaptor.java?view=diff&rev=532431&r1=532430&r2=532431
==============================================================================
--- 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ArchivaConfigurationAdaptor.java
 (original)
+++ 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ArchivaConfigurationAdaptor.java
 Wed Apr 25 11:07:06 2007
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.configuration.RepositoryConfiguration;
 import org.apache.maven.archiva.model.ArchivaRepository;
 
@@ -33,9 +34,27 @@
 {
     public static ArchivaRepository toArchivaRepository( 
RepositoryConfiguration config )
     {
+        if ( config == null )
+        {
+            throw new IllegalArgumentException( "Unable to convert null 
repository config to archiva repository." );
+        }
+
+        if ( StringUtils.isBlank( config.getId() ) )
+        {
+            throw new IllegalArgumentException( "Unable to repository config 
with blank ID to archiva repository." );
+        }
+
+        if ( StringUtils.isBlank( config.getUrl() ) )
+        {
+            throw new IllegalArgumentException(
+                                                "Unable to convert repository 
config with blank URL to archiva repository." );
+        }
+
         ArchivaRepository repository = new ArchivaRepository( config.getId(), 
config.getName(), config.getUrl() );
 
         repository.getModel().setLayoutName( config.getLayout() );
+        repository.getModel().setReleasePolicy( config.isReleases() );
+        repository.getModel().setSnapshotPolicy( config.isSnapshots() );
 
         return repository;
     }

Modified: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/pom.xml?view=diff&rev=532431&r1=532430&r2=532431
==============================================================================
--- 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/pom.xml 
(original)
+++ 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/pom.xml 
Wed Apr 25 11:07:06 2007
@@ -115,20 +115,6 @@
       <plugin>
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>merge</id>
-            <goals>
-              <goal>merge-descriptors</goal>
-            </goals>
-            <configuration>
-              <descriptors>
-                
<descriptor>${basedir}/src/main/resources/META-INF/plexus/components.xml</descriptor>
-                
<descriptor>${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml</descriptor>
-              </descriptors>
-            </configuration>
-          </execution>
-        </executions>
       </plugin>
     </plugins>
   </build>

Added: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/ArchivaTaskQueue.java
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/ArchivaTaskQueue.java?view=auto&rev=532431
==============================================================================
--- 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/ArchivaTaskQueue.java
 (added)
+++ 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/ArchivaTaskQueue.java
 Wed Apr 25 11:07:06 2007
@@ -0,0 +1,42 @@
+package org.apache.maven.archiva.scheduled;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.codehaus.plexus.taskqueue.DefaultTaskQueue;
+
+/**
+ * ArchivaTaskQueue 
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Joakim Erdfelt</a>
+ * @version $Id$
+ * @plexus.component role="org.codehaus.plexus.taskqueue.TaskQueue" 
+ *                   role-hint="archiva-task-queue"
+ *                   lifecycle-handler="plexus-configurable"
+ */
+public class ArchivaTaskQueue
+    extends DefaultTaskQueue
+{
+
+    public ArchivaTaskQueue()
+    {
+        super();
+        /* do nothing special */
+    }
+}

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/ArchivaTaskQueue.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/ArchivaTaskQueue.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/ArchivaTaskQueue.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/DefaultArchivaTaskScheduler.java
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/DefaultArchivaTaskScheduler.java?view=diff&rev=532431&r1=532430&r2=532431
==============================================================================
--- 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/DefaultArchivaTaskScheduler.java
 (original)
+++ 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/DefaultArchivaTaskScheduler.java
 Wed Apr 25 11:07:06 2007
@@ -50,7 +50,7 @@
  *
  * @author <a href="mailto:[EMAIL PROTECTED]">Brett Porter</a>
  * @author <a href="mailto:[EMAIL PROTECTED]">Jesse McConnell</a>
- * @plexus.component 
role="org.apache.maven.archiva.scheduler.ArchivaTaskScheduler"
+ * @plexus.component 
role="org.apache.maven.archiva.scheduled.ArchivaTaskScheduler" 
role-hint="default"
  */
 public class DefaultArchivaTaskScheduler
     extends AbstractLogEnabled

Modified: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/check/RoleExistanceEnvironmentCheck.java
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/check/RoleExistanceEnvironmentCheck.java?view=diff&rev=532431&r1=532430&r2=532431
==============================================================================
--- 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/check/RoleExistanceEnvironmentCheck.java
 (original)
+++ 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/check/RoleExistanceEnvironmentCheck.java
 Wed Apr 25 11:07:06 2007
@@ -73,7 +73,7 @@
                     Iterator it = repos.iterator();
                     while ( it.hasNext() )
                     {
-                        RepositoryConfiguration repository = 
(RepositoryConfiguration) it.next();
+                        ArchivaRepository repository = (ArchivaRepository) 
it.next();
 
                         roleProfileManager.getDynamicRole( 
"archiva-repository-manager", repository.getId() );
 

Added: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java?view=auto&rev=532431
==============================================================================
--- 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java
 (added)
+++ 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java
 Wed Apr 25 11:07:06 2007
@@ -0,0 +1,98 @@
+package org.apache.maven.archiva.web.startup;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.commons.lang.StringUtils;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Properties;
+
+/**
+ * ArchivaVersion 
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class ArchivaVersion
+{
+    public static String determineVersion( ClassLoader cloader )
+    {
+        /* This is the search order of modules to find the version.
+         */
+        String modules[] = new String[] {
+            "archiva-common",
+            "archiva-configuration",
+            "archiva-database",
+            "archiva-consumer-api",
+            "archiva-core-consumers",
+            "archiva-signature-consumers",
+            "archiva-database-consumers",
+            "archiva-lucene-consumers",
+            "archiva-indexer",
+            "archiva-model",
+            "archiva-policies",
+            "archiva-proxy",
+            "archiva-report-manager",
+            "archiva-artifact-reports",
+            "archiva-project-reports",
+            "archiva-metadata-reports",
+            "archiva-repository-layer",
+            "archiva-scheduled",
+            "archiva-webapp",
+            "archiva-security",
+            "archiva-applet",
+            "archiva-cli",
+            "archiva-xml-tools" };
+
+        for ( int i = 0; i < modules.length; i++ )
+        {
+            String module = modules[i];
+            URL pomurl = findModulePom( cloader, module );
+            if ( pomurl != null )
+            {
+                try
+                {
+                    Properties props = new Properties();
+                    InputStream is = pomurl.openStream();
+                    props.load( is );
+                    String version = props.getProperty( "version" );
+                    if ( StringUtils.isNotBlank( version ) )
+                    {
+                        return version;
+                    }
+                }
+                catch ( IOException e )
+                {
+                    /* do nothing */
+                }
+            }
+        }
+
+        return "Unknown";
+    }
+
+    private static URL findModulePom( ClassLoader cloader, String module )
+    {
+        URL ret = cloader.getResource( 
"/META-INF/maven/org.apache.maven.archiva/" + module + "/pom.properties" );
+        return ret;
+    }
+}

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/Banner.java
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/Banner.java?view=auto&rev=532431
==============================================================================
--- 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/Banner.java
 (added)
+++ 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/Banner.java
 Wed Apr 25 11:07:06 2007
@@ -0,0 +1,225 @@
+package org.apache.maven.archiva.web.startup;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.commons.lang.StringUtils;
+import org.codehaus.plexus.logging.Logger;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Banner 
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class Banner
+{
+    public static String encode( String raw )
+    {
+        StringBuffer encoded = new StringBuffer();
+        int rawlen = raw.length();
+
+        for ( int i = 0; i < rawlen; i++ )
+        {
+            char c = raw.charAt( i );
+            if ( c == '\\' )
+            {
+                encoded.append( "$." );
+            }
+            else if ( c == '$' )
+            {
+                encoded.append( "$$" );
+            }
+            else if ( c == '\n' )
+            {
+                encoded.append( "$n" );
+            }
+            else if ( Character.isDigit( c ) )
+            {
+                encoded.append( c );
+            }
+            else if ( Character.isLetter( c ) )
+            {
+                encoded.append( rot13( c ) );
+            }
+            else if ( i < raw.length() - 1 )
+            {
+                char nc;
+                boolean done = false;
+                int count = 0;
+                for ( int n = i; !done; n++ )
+                {
+                    if ( n >= rawlen )
+                    {
+                        break;
+                    }
+
+                    nc = raw.charAt( n );
+
+                    if ( nc != c )
+                    {
+                        done = true;
+                    }
+                    else
+                    {
+                        count++;
+                    }
+                }
+                if ( count < 3 )
+                {
+                    encoded.append( c );
+                }
+                else
+                {
+                    encoded.append( "$" ).append( String.valueOf( count ) 
).append( c );
+                    i += count - 1;
+                }
+            }
+            else
+            {
+                encoded.append( c );
+            }
+        }
+
+        return encoded.toString();
+    }
+
+    public static String decode( String encoded )
+    {
+        StringBuffer decoded = new StringBuffer();
+        int enlen = encoded.length();
+        for ( int i = 0; i < enlen; i++ )
+        {
+            char c = encoded.charAt( i );
+            if ( c == '$' )
+            {
+                char nc = encoded.charAt( i + 1 );
+                if ( nc == '$' )
+                {
+                    decoded.append( '$' );
+                    i++;
+                }
+                else if ( nc == '.' )
+                {
+                    decoded.append( '\\' );
+                    i++;
+                }
+                else if ( nc == 'n' )
+                {
+                    decoded.append( '\n' );
+                    i++;
+                }
+                else if ( Character.isDigit( nc ) )
+                {
+                    int count = 0;
+                    int nn = i + 1;
+                    while ( Character.isDigit( nc ) )
+                    {
+                        count = ( count * 10 );
+                        count += ( nc - '0' );
+                        nc = encoded.charAt( ++nn );
+                    }
+                    for ( int d = 0; d < count; d++ )
+                    {
+                        decoded.append( nc );
+                    }
+                    i = nn;
+                }
+            }
+            else if ( Character.isLetter( c ) )
+            {
+                decoded.append( rot13( c ) );
+            }
+            else
+            {
+                decoded.append( c );
+            }
+        }
+
+        return decoded.toString();
+    }
+
+    private static char rot13( char c )
+    {
+        if ( ( c >= 'a' ) && ( c <= 'z' ) )
+        {
+            char dc = c += 13;
+            if ( dc > 'z' )
+            {
+                dc -= 26;
+            }
+            return dc;
+        }
+        else if ( ( c >= 'A' ) && ( c <= 'Z' ) )
+        {
+            char dc = c += 13;
+            if ( dc > 'Z' )
+            {
+                dc -= 26;
+            }
+            return dc;
+        }
+        else
+        {
+            return c;
+        }
+    }
+
+    public static String injectVersion( String text, String version )
+    {
+        Pattern pat = Pattern.compile( "#{2,}" );
+        Matcher mat = pat.matcher( text );
+        StringBuffer ret = new StringBuffer();
+        int off = 0;
+
+        while ( mat.find( off ) )
+        {
+            ret.append( text.substring( off, mat.start() ) );
+            String repl = mat.group();
+            ret.append( StringUtils.center( version, repl.length() ) );
+            off = mat.end();
+        }
+
+        ret.append( text.substring( off ) );
+
+        return ret.toString();
+    }
+
+    public static String getBanner( String version )
+    {
+        String encodedBanner = "$26 $34_$n$15 /$._$7 /$34 $.$n$14 /`/@),$4 |  
Ba" +
+                " orunys bs nyy bs gur nycnpn'f  |$n$14 |  (~'  __|  gbvyvat 
njnl ba " +
+                "gur Ncnpur Znira  |$n$6 _,--.$3_/  |$4 $.$5 cebwrpg grnzf, V 
jbhyq y" +
+                "vxr gb$3 |$n$4 ,' ,$5 ($3 |$5 $.$5 jrypbzr lbh gb Znira 
Nepuvin$4 |$" +
+                "n$4 |  ($6 $.  /$6 |  $32#  |$n$5 $.  )$._/  ,_/$7 |$36 |$n$5 
/ /$3 " +
+                "( |/$9 |  uggc://znira.ncnpur.bet/nepuvin/  |$n$4 ( |$4 ( 
|$10 |  ne" +
+                "[EMAIL PROTECTED] |$n$5 $.|$5 $.|$11 $.$34_/$n$n";
+
+        return injectVersion( decode( encodedBanner ), version );
+    }
+
+    public static void display( Logger logger, String version )
+    {
+        String banner = getBanner( version );
+        logger.info( StringUtils.repeat( "_", 25 ) + "\n" + banner );
+    }
+}

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/Banner.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/Banner.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/Banner.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ConfigurationSynchronization.java
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ConfigurationSynchronization.java?view=auto&rev=532431
==============================================================================
--- 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ConfigurationSynchronization.java
 (added)
+++ 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ConfigurationSynchronization.java
 Wed Apr 25 11:07:06 2007
@@ -0,0 +1,121 @@
+package org.apache.maven.archiva.web.startup;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.ConfigurationNames;
+import org.apache.maven.archiva.configuration.RepositoryConfiguration;
+import org.apache.maven.archiva.database.ArchivaDAO;
+import org.apache.maven.archiva.database.ArchivaDatabaseException;
+import org.apache.maven.archiva.database.ObjectNotFoundException;
+import org.apache.maven.archiva.model.ArchivaRepository;
+import org.apache.maven.archiva.repository.ArchivaConfigurationAdaptor;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import 
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
+import org.codehaus.plexus.registry.Registry;
+import org.codehaus.plexus.registry.RegistryListener;
+
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * ConfigurationSynchronization 
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Joakim Erdfelt</a>
+ * @version $Id$
+ * 
+ * @plexus.component 
role="org.apache.maven.archiva.web.startup.ConfigurationSynchronization"
+ *                   role-hint="default"
+ */
+public class ConfigurationSynchronization
+    extends AbstractLogEnabled
+    implements RegistryListener, Initializable
+{
+    /**
+     * @plexus.requirement
+     */
+    private ArchivaDAO dao;
+
+    /**
+     * @plexus.requirement
+     */
+    private ArchivaConfiguration archivaConfiguration;
+
+    public void afterConfigurationChange( Registry registry, String 
propertyName, Object propertyValue )
+    {
+        if ( ConfigurationNames.isRepositories( propertyName ) )
+        {
+            synchConfiguration();
+        }
+    }
+
+    public void beforeConfigurationChange( Registry registry, String 
propertyName, Object propertyValue )
+    {
+        /* do nothing */
+    }
+
+    private void synchConfiguration()
+    {
+        List repos = archivaConfiguration.getConfiguration().getRepositories();
+        Iterator it = repos.iterator();
+        while ( it.hasNext() )
+        {
+            RepositoryConfiguration repoConfig = (RepositoryConfiguration) 
it.next();
+            try
+            {
+                try
+                {
+                    ArchivaRepository repository = 
dao.getRepositoryDAO().getRepository( repoConfig.getId() );
+                    // Found repository.  Update it.
+
+                    repository.getModel().setName( repoConfig.getName() );
+                    repository.getModel().setUrl( repoConfig.getUrl() );
+                    repository.getModel().setLayoutName( 
repoConfig.getLayout() );
+                    repository.getModel().setCreationSource( "configuration" );
+                    repository.getModel().setReleasePolicy( 
repoConfig.isReleases() );
+                    repository.getModel().setSnapshotPolicy( 
repoConfig.isSnapshots() );
+
+                    dao.getRepositoryDAO().saveRepository( repository );
+                }
+                catch ( ObjectNotFoundException e )
+                {
+                    // Add the repository to the database.
+                    getLogger().info( "Adding repository configuration to DB: 
" + repoConfig );
+                    ArchivaRepository drepo = 
ArchivaConfigurationAdaptor.toArchivaRepository( repoConfig );
+                    drepo.getModel().setCreationSource( "configuration" );
+                    dao.getRepositoryDAO().saveRepository( drepo );
+                }
+            }
+            catch ( ArchivaDatabaseException e )
+            {
+                // Log error.
+                getLogger().error( "Unable to add configured repositories to 
the database: " + e.getMessage(), e );
+            }
+        }
+    }
+
+    public void initialize()
+        throws InitializationException
+    {
+        Banner.display( getLogger(), ArchivaVersion.determineVersion( 
this.getClass().getClassLoader() ) );
+        synchConfiguration();
+    }
+}

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ConfigurationSynchronization.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ConfigurationSynchronization.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ConfigurationSynchronization.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/resources/META-INF/plexus/application.xml
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/resources/META-INF/plexus/application.xml?view=diff&rev=532431&r1=532430&r2=532431
==============================================================================
--- 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/resources/META-INF/plexus/application.xml
 (original)
+++ 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/resources/META-INF/plexus/application.xml
 Wed Apr 25 11:07:06 2007
@@ -196,12 +196,27 @@
 
   <load-on-start>
     <component>
-      <role>org.apache.maven.archiva.scheduler.RepositoryTaskScheduler</role>
+      <role>org.apache.maven.archiva.configuration.ConfigurationUpgrade</role>
+      <role-hint>default</role-hint>
     </component>
     <component>
+      
<role>org.apache.maven.archiva.web.startup.ConfigurationSynchronization</role>
+      <role-hint>default</role-hint>
+    </component>
+    <component>
+      
<role>org.apache.maven.archiva.web.startup.ConfigurationSynchronization</role>
+      <role-hint>default</role-hint>
+    </component>
+    <component>
+      <role>org.apache.maven.archiva.scheduled.ArchivaTaskScheduler</role>
+      <role-hint>default</role-hint>
+    </component>
+    <!-- 
+    <component>
       <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
-      <role-hint>data-refresh</role-hint>
+      <role-hint>archiva-task-executor</role-hint>
     </component>
+      -->
   </load-on-start>
 
   <lifecycle-handler-manager 
implementation="org.codehaus.plexus.lifecycle.DefaultLifecycleHandlerManager">

Modified: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/resources/log4j.xml
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/resources/log4j.xml?view=diff&rev=532431&r1=532430&r2=532431
==============================================================================
--- 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/resources/log4j.xml
 (original)
+++ 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/main/resources/log4j.xml
 Wed Apr 25 11:07:06 2007
@@ -15,7 +15,7 @@
   <appender name="console" class="org.apache.log4j.ConsoleAppender">
     <param name="Target" value="System.out"/>
     <layout class="org.apache.log4j.PatternLayout">
-      <param name="ConversionPattern" value="%d [%t] %-5p %-30c{1} - %m%n"/>
+      <param name="ConversionPattern" value="%d [%t] %-5p %c{1} - %m%n"/>
     </layout>
   </appender>
 

Added: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/startup/BannerTest.java
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/startup/BannerTest.java?view=auto&rev=532431
==============================================================================
--- 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/startup/BannerTest.java
 (added)
+++ 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/startup/BannerTest.java
 Wed Apr 25 11:07:06 2007
@@ -0,0 +1,90 @@
+package org.apache.maven.archiva.web.startup;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.commons.io.IOUtils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.zip.GZIPInputStream;
+
+import junit.framework.TestCase;
+
+/**
+ * BannerTest 
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class BannerTest
+    extends TestCase
+{
+    private void assertEncodeDecode( String encoded, String decoded )
+    {
+        assertEquals( "Encoding: ", encoded, Banner.encode( decoded ) );
+        assertEquals( "Decoding: ", decoded, Banner.decode( encoded ) );
+    }
+
+    public void testEncodeDecode()
+    {
+        assertEncodeDecode( "[$10 ]", "[          ]" );
+        assertEncodeDecode( "$$$5_$n$5_", "$_____\n_____" );
+        assertEncodeDecode( "$${Refgjuvyr}", "${Erstwhile}" );
+    }
+
+    public void testInjectVersion()
+    {
+        assertEquals( "[ 1.0 ]", Banner.injectVersion( "[#####]", "1.0" ) );
+        assertEquals( ".\\  1.0-SNAPSHOT  \\._____", Banner.injectVersion( 
".\\################\\._____",
+                                                                           
"1.0-SNAPSHOT" ) );
+        assertEquals( "Archiva:\n ( 1.0-alpha-1  )", Banner
+            .injectVersion( "Archiva:\n (##############)", "1.0-alpha-1" ) );
+    }
+
+    public void testGetBanner()
+        throws IOException
+    {
+        String version = "1.0-alpha-1-SNAPSHOT";
+        String banner = Banner.getBanner( version );
+        assertNotNull( "Banner should not be null.", banner );
+        assertTrue( "Banner contains version.", banner.indexOf( version ) > 0 
);
+        
+        /* Want to make a new banner?
+         * Steps to do it.
+         * 1) Edit the src/test/resources/banner.gz file.
+         * 2) Save it compressed.
+         * 3) Add (to this test method) ...
+         *    System.out.println( "\"" + Banner.encode( getRawBanner() ) + 
"\"" );
+         * 4) Run the test
+         * 5) Copy / Paste the encoded form into the Banner.getBanner() method.
+         */
+    }
+
+    public String getRawBanner()
+        throws IOException
+    {
+        File gzBanner = new File( "src/test/resources/banner.gz" );
+        assertTrue( "File [" + gzBanner.getPath() + "] not found.", 
gzBanner.exists() );
+        FileInputStream fis = new FileInputStream( gzBanner );
+        GZIPInputStream gzis = new GZIPInputStream( fis );
+        return IOUtils.toString( gzis );
+    }
+}

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/startup/BannerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/startup/BannerTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/startup/BannerTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/test/resources/banner.gz
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/test/resources/banner.gz?view=auto&rev=532431
==============================================================================
Binary file - no diff available.

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/test/resources/banner.gz
------------------------------------------------------------------------------
    svn:executable = *

Propchange: 
maven/archiva/branches/archiva-jpox-database-refactor/archiva-web/archiva-webapp/src/test/resources/banner.gz
------------------------------------------------------------------------------
    svn:mime-type = application/gzip


Reply via email to