summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base
diff options
context:
space:
mode:
authorskygo <skygo@unknown>2014-03-04 00:59:50 +0000
committerskygo <skygo@unknown>2014-03-04 00:59:50 +0000
commit3f378e23fd6b668d54c85510972d020255f962e5 (patch)
tree76dd810d92af39825288cccd2b5081c903f18a74 /archiva-modules/archiva-base
parentfa7cfcaa28b75d54d65aa88cdb7249e809384131 (diff)
downloadarchiva-3f378e23fd6b668d54c85510972d020255f962e5.tar.gz
archiva-3f378e23fd6b668d54c85510972d020255f962e5.zip
refresh Common @Override, package level jdoc for api ref, resolve File.toUrl deprecation
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1573835 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base')
-rw-r--r--archiva-modules/archiva-base/archiva-common/pom.xml1
-rw-r--r--archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/package-info.java19
-rw-r--r--archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/PathUtil.java2
-rw-r--r--archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/Slf4JPlexusLogger.java21
-rw-r--r--archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/VersionComparator.java5
-rw-r--r--archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/VersionUtil.java7
-rw-r--r--archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/package-info.java19
7 files changed, 63 insertions, 11 deletions
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 @@
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
- <version>1.6.1</version>
<scope>test</scope>
</dependency>
</dependencies>
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<String>
{
- private static Comparator<String> INSTANCE = new VersionComparator();
+ private static final Comparator<String> INSTANCE = new VersionComparator();
- private List<String> specialWords;
+ private final List<String> 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;