diff --git a/archiva-modules/archiva-base/archiva-common/pom.xml b/archiva-modules/archiva-base/archiva-common/pom.xml
index 01e541896..2f9b15e89 100644
--- a/archiva-modules/archiva-base/archiva-common/pom.xml
+++ b/archiva-modules/archiva-base/archiva-common/pom.xml
@@ -54,7 +54,6 @@
dom4j
dom4j
- 1.6.1
test
diff --git a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/package-info.java b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/package-info.java
new file mode 100644
index 000000000..fdeca4770
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2014 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+/**
+ * Provides archiva base exception and file type pattern.
+ */
+package org.apache.archiva.common;
diff --git a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/PathUtil.java b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/PathUtil.java
index 69c6ea893..ddafc3e0f 100644
--- a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/PathUtil.java
+++ b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/PathUtil.java
@@ -46,7 +46,7 @@ public class PathUtil
{
try
{
- return file.toURL().toExternalForm();
+ return file.toURI().toURL().toExternalForm();
}
catch ( MalformedURLException e )
{
diff --git a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/Slf4JPlexusLogger.java b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/Slf4JPlexusLogger.java
index 960e550d2..693bc1c82 100644
--- a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/Slf4JPlexusLogger.java
+++ b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/Slf4JPlexusLogger.java
@@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory;
public class Slf4JPlexusLogger
implements org.codehaus.plexus.logging.Logger
{
- private Logger log;
+ private final Logger log;
public Slf4JPlexusLogger( Class> clazz )
{
@@ -43,46 +43,55 @@ public class Slf4JPlexusLogger
log = LoggerFactory.getLogger( name );
}
+ @Override
public void debug( String message )
{
log.debug( message );
}
+ @Override
public void debug( String message, Throwable throwable )
{
log.debug( message, throwable );
}
+ @Override
public void error( String message )
{
log.error( message );
}
+ @Override
public void error( String message, Throwable throwable )
{
log.error( message, throwable );
}
+ @Override
public void fatalError( String message )
{
log.error( message );
}
+ @Override
public void fatalError( String message, Throwable throwable )
{
log.error( message, throwable );
}
+ @Override
public org.codehaus.plexus.logging.Logger getChildLogger( String name )
{
return new Slf4JPlexusLogger( log.getName() + "." + name );
}
+ @Override
public String getName()
{
return log.getName();
}
+ @Override
public int getThreshold()
{
if ( log.isTraceEnabled() )
@@ -109,51 +118,61 @@ public class Slf4JPlexusLogger
return org.codehaus.plexus.logging.Logger.LEVEL_DISABLED;
}
+ @Override
public void info( String message )
{
log.info( message );
}
+ @Override
public void info( String message, Throwable throwable )
{
log.info( message, throwable );
}
+ @Override
public boolean isDebugEnabled()
{
return log.isDebugEnabled();
}
+ @Override
public boolean isErrorEnabled()
{
return log.isErrorEnabled();
}
+ @Override
public boolean isFatalErrorEnabled()
{
return log.isErrorEnabled();
}
+ @Override
public boolean isInfoEnabled()
{
return log.isInfoEnabled();
}
+ @Override
public boolean isWarnEnabled()
{
return log.isWarnEnabled();
}
+ @Override
public void setThreshold( int threshold )
{
/* do nothing */
}
+ @Override
public void warn( String message )
{
log.warn( message );
}
+ @Override
public void warn( String message, Throwable throwable )
{
log.warn( message, throwable );
diff --git a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/VersionComparator.java b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/VersionComparator.java
index e39a2e9a6..73d0cd752 100644
--- a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/VersionComparator.java
+++ b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/VersionComparator.java
@@ -54,9 +54,9 @@ import java.util.List;
public class VersionComparator
implements Comparator
{
- private static Comparator INSTANCE = new VersionComparator();
+ private static final Comparator INSTANCE = new VersionComparator();
- private List specialWords;
+ private final List specialWords;
public VersionComparator()
{
@@ -97,6 +97,7 @@ public class VersionComparator
return INSTANCE;
}
+ @Override
public int compare( String o1, String o2 )
{
if ( o1 == null && o2 == null )
diff --git a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/VersionUtil.java b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/VersionUtil.java
index ab3322027..f00144d55 100644
--- a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/VersionUtil.java
+++ b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/VersionUtil.java
@@ -177,12 +177,7 @@ public class VersionUtil
public static boolean isUniqueSnapshot( String version )
{
Matcher m = UNIQUE_SNAPSHOT_PATTERN.matcher( version );
- if ( m.matches() )
- {
- return true;
- }
-
- return false;
+ return m.matches();
}
public static boolean isGenericSnapshot( String version )
diff --git a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/package-info.java b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/package-info.java
new file mode 100644
index 000000000..cf4594991
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2014 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+/**
+ * Provides utilities classes for Apache Archiva modules.
+ */
+package org.apache.archiva.common.utils;