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
This commit is contained in:
skygo 2014-03-04 00:59:50 +00:00
parent fa7cfcaa28
commit 3f378e23fd
7 changed files with 63 additions and 11 deletions

View File

@ -54,7 +54,6 @@
<dependency> <dependency>
<groupId>dom4j</groupId> <groupId>dom4j</groupId>
<artifactId>dom4j</artifactId> <artifactId>dom4j</artifactId>
<version>1.6.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -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;

View File

@ -46,7 +46,7 @@ public class PathUtil
{ {
try try
{ {
return file.toURL().toExternalForm(); return file.toURI().toURL().toExternalForm();
} }
catch ( MalformedURLException e ) catch ( MalformedURLException e )
{ {

View File

@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory;
public class Slf4JPlexusLogger public class Slf4JPlexusLogger
implements org.codehaus.plexus.logging.Logger implements org.codehaus.plexus.logging.Logger
{ {
private Logger log; private final Logger log;
public Slf4JPlexusLogger( Class<?> clazz ) public Slf4JPlexusLogger( Class<?> clazz )
{ {
@ -43,46 +43,55 @@ public class Slf4JPlexusLogger
log = LoggerFactory.getLogger( name ); log = LoggerFactory.getLogger( name );
} }
@Override
public void debug( String message ) public void debug( String message )
{ {
log.debug( message ); log.debug( message );
} }
@Override
public void debug( String message, Throwable throwable ) public void debug( String message, Throwable throwable )
{ {
log.debug( message, throwable ); log.debug( message, throwable );
} }
@Override
public void error( String message ) public void error( String message )
{ {
log.error( message ); log.error( message );
} }
@Override
public void error( String message, Throwable throwable ) public void error( String message, Throwable throwable )
{ {
log.error( message, throwable ); log.error( message, throwable );
} }
@Override
public void fatalError( String message ) public void fatalError( String message )
{ {
log.error( message ); log.error( message );
} }
@Override
public void fatalError( String message, Throwable throwable ) public void fatalError( String message, Throwable throwable )
{ {
log.error( message, throwable ); log.error( message, throwable );
} }
@Override
public org.codehaus.plexus.logging.Logger getChildLogger( String name ) public org.codehaus.plexus.logging.Logger getChildLogger( String name )
{ {
return new Slf4JPlexusLogger( log.getName() + "." + name ); return new Slf4JPlexusLogger( log.getName() + "." + name );
} }
@Override
public String getName() public String getName()
{ {
return log.getName(); return log.getName();
} }
@Override
public int getThreshold() public int getThreshold()
{ {
if ( log.isTraceEnabled() ) if ( log.isTraceEnabled() )
@ -109,51 +118,61 @@ public class Slf4JPlexusLogger
return org.codehaus.plexus.logging.Logger.LEVEL_DISABLED; return org.codehaus.plexus.logging.Logger.LEVEL_DISABLED;
} }
@Override
public void info( String message ) public void info( String message )
{ {
log.info( message ); log.info( message );
} }
@Override
public void info( String message, Throwable throwable ) public void info( String message, Throwable throwable )
{ {
log.info( message, throwable ); log.info( message, throwable );
} }
@Override
public boolean isDebugEnabled() public boolean isDebugEnabled()
{ {
return log.isDebugEnabled(); return log.isDebugEnabled();
} }
@Override
public boolean isErrorEnabled() public boolean isErrorEnabled()
{ {
return log.isErrorEnabled(); return log.isErrorEnabled();
} }
@Override
public boolean isFatalErrorEnabled() public boolean isFatalErrorEnabled()
{ {
return log.isErrorEnabled(); return log.isErrorEnabled();
} }
@Override
public boolean isInfoEnabled() public boolean isInfoEnabled()
{ {
return log.isInfoEnabled(); return log.isInfoEnabled();
} }
@Override
public boolean isWarnEnabled() public boolean isWarnEnabled()
{ {
return log.isWarnEnabled(); return log.isWarnEnabled();
} }
@Override
public void setThreshold( int threshold ) public void setThreshold( int threshold )
{ {
/* do nothing */ /* do nothing */
} }
@Override
public void warn( String message ) public void warn( String message )
{ {
log.warn( message ); log.warn( message );
} }
@Override
public void warn( String message, Throwable throwable ) public void warn( String message, Throwable throwable )
{ {
log.warn( message, throwable ); log.warn( message, throwable );

View File

@ -54,9 +54,9 @@ import java.util.List;
public class VersionComparator public class VersionComparator
implements Comparator<String> 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() public VersionComparator()
{ {
@ -97,6 +97,7 @@ public class VersionComparator
return INSTANCE; return INSTANCE;
} }
@Override
public int compare( String o1, String o2 ) public int compare( String o1, String o2 )
{ {
if ( o1 == null && o2 == null ) if ( o1 == null && o2 == null )

View File

@ -177,12 +177,7 @@ public class VersionUtil
public static boolean isUniqueSnapshot( String version ) public static boolean isUniqueSnapshot( String version )
{ {
Matcher m = UNIQUE_SNAPSHOT_PATTERN.matcher( version ); Matcher m = UNIQUE_SNAPSHOT_PATTERN.matcher( version );
if ( m.matches() ) return m.matches();
{
return true;
}
return false;
} }
public static boolean isGenericSnapshot( String version ) public static boolean isGenericSnapshot( String version )

View File

@ -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;