mirror of https://github.com/apache/archiva.git
fix formatting no functionnal changes
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1203664 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
046cc5f5d9
commit
fcb3e8c534
|
@ -78,8 +78,8 @@ public class BaseFile
|
||||||
public BaseFile( URI uri )
|
public BaseFile( URI uri )
|
||||||
{
|
{
|
||||||
super( uri ); // only to satisfy java compiler.
|
super( uri ); // only to satisfy java compiler.
|
||||||
throw new IllegalStateException( "The " + BaseFile.class.getName()
|
throw new IllegalStateException(
|
||||||
+ " object does not support URI construction." );
|
"The " + BaseFile.class.getName() + " object does not support URI construction." );
|
||||||
}
|
}
|
||||||
|
|
||||||
public File getBaseDir()
|
public File getBaseDir()
|
||||||
|
|
|
@ -100,7 +100,7 @@ public class PathUtil
|
||||||
}
|
}
|
||||||
|
|
||||||
// File is not within basedir.
|
// File is not within basedir.
|
||||||
throw new IllegalStateException( "Unable to obtain relative path of file " + child
|
throw new IllegalStateException(
|
||||||
+ ", it is not within basedir " + basedir + "." );
|
"Unable to obtain relative path of file " + child + ", it is not within basedir " + basedir + "." );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,102 +28,134 @@ import org.slf4j.LoggerFactory;
|
||||||
*
|
*
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class Slf4JPlexusLogger implements org.codehaus.plexus.logging.Logger {
|
public class Slf4JPlexusLogger
|
||||||
|
implements org.codehaus.plexus.logging.Logger
|
||||||
|
{
|
||||||
private Logger log;
|
private Logger log;
|
||||||
|
|
||||||
public Slf4JPlexusLogger(Class<?> clazz) {
|
public Slf4JPlexusLogger( Class<?> clazz )
|
||||||
log = LoggerFactory.getLogger(clazz);
|
{
|
||||||
|
log = LoggerFactory.getLogger( clazz );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Slf4JPlexusLogger(String name) {
|
public Slf4JPlexusLogger( String name )
|
||||||
log = LoggerFactory.getLogger(name);
|
{
|
||||||
|
log = LoggerFactory.getLogger( name );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void debug(String message) {
|
public void debug( String message )
|
||||||
log.debug(message);
|
{
|
||||||
|
log.debug( message );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void debug(String message, Throwable throwable) {
|
public void debug( String message, Throwable throwable )
|
||||||
log.debug(message, throwable);
|
{
|
||||||
|
log.debug( message, throwable );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void error(String message) {
|
public void error( String message )
|
||||||
log.error(message);
|
{
|
||||||
|
log.error( message );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void error(String message, Throwable throwable) {
|
public void error( String message, Throwable throwable )
|
||||||
log.error(message, throwable);
|
{
|
||||||
|
log.error( message, throwable );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fatalError(String message) {
|
public void fatalError( String message )
|
||||||
log.error(message);
|
{
|
||||||
|
log.error( message );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fatalError(String message, Throwable throwable) {
|
public void fatalError( String message, Throwable throwable )
|
||||||
log.error(message, throwable);
|
{
|
||||||
|
log.error( message, throwable );
|
||||||
}
|
}
|
||||||
|
|
||||||
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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName()
|
||||||
|
{
|
||||||
return log.getName();
|
return log.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getThreshold() {
|
public int getThreshold()
|
||||||
if (log.isTraceEnabled()) {
|
{
|
||||||
|
if ( log.isTraceEnabled() )
|
||||||
|
{
|
||||||
return org.codehaus.plexus.logging.Logger.LEVEL_DEBUG;
|
return org.codehaus.plexus.logging.Logger.LEVEL_DEBUG;
|
||||||
} else if (log.isDebugEnabled()) {
|
}
|
||||||
|
else if ( log.isDebugEnabled() )
|
||||||
|
{
|
||||||
return org.codehaus.plexus.logging.Logger.LEVEL_DEBUG;
|
return org.codehaus.plexus.logging.Logger.LEVEL_DEBUG;
|
||||||
} else if (log.isInfoEnabled()) {
|
}
|
||||||
|
else if ( log.isInfoEnabled() )
|
||||||
|
{
|
||||||
return org.codehaus.plexus.logging.Logger.LEVEL_INFO;
|
return org.codehaus.plexus.logging.Logger.LEVEL_INFO;
|
||||||
} else if (log.isWarnEnabled()) {
|
}
|
||||||
|
else if ( log.isWarnEnabled() )
|
||||||
|
{
|
||||||
return org.codehaus.plexus.logging.Logger.LEVEL_WARN;
|
return org.codehaus.plexus.logging.Logger.LEVEL_WARN;
|
||||||
} else if (log.isErrorEnabled()) {
|
}
|
||||||
|
else if ( log.isErrorEnabled() )
|
||||||
|
{
|
||||||
return org.codehaus.plexus.logging.Logger.LEVEL_ERROR;
|
return org.codehaus.plexus.logging.Logger.LEVEL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
return org.codehaus.plexus.logging.Logger.LEVEL_DISABLED;
|
return org.codehaus.plexus.logging.Logger.LEVEL_DISABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void info(String message) {
|
public void info( String message )
|
||||||
log.info(message);
|
{
|
||||||
|
log.info( message );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void info(String message, Throwable throwable) {
|
public void info( String message, Throwable throwable )
|
||||||
log.info(message, throwable);
|
{
|
||||||
|
log.info( message, throwable );
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDebugEnabled() {
|
public boolean isDebugEnabled()
|
||||||
|
{
|
||||||
return log.isDebugEnabled();
|
return log.isDebugEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isErrorEnabled() {
|
public boolean isErrorEnabled()
|
||||||
|
{
|
||||||
return log.isErrorEnabled();
|
return log.isErrorEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFatalErrorEnabled() {
|
public boolean isFatalErrorEnabled()
|
||||||
|
{
|
||||||
return log.isErrorEnabled();
|
return log.isErrorEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInfoEnabled() {
|
public boolean isInfoEnabled()
|
||||||
|
{
|
||||||
return log.isInfoEnabled();
|
return log.isInfoEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isWarnEnabled() {
|
public boolean isWarnEnabled()
|
||||||
|
{
|
||||||
return log.isWarnEnabled();
|
return log.isWarnEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setThreshold(int threshold) {
|
public void setThreshold( int threshold )
|
||||||
|
{
|
||||||
/* do nothing */
|
/* do nothing */
|
||||||
}
|
}
|
||||||
|
|
||||||
public void warn(String message) {
|
public void warn( String message )
|
||||||
log.warn(message);
|
{
|
||||||
|
log.warn( message );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void warn(String message, Throwable throwable) {
|
public void warn( String message, Throwable throwable )
|
||||||
log.warn(message, throwable);
|
{
|
||||||
|
log.warn( message, throwable );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,26 +35,12 @@ public class VersionUtil
|
||||||
* These are the version patterns found in the filenames of the various artifact's versions IDs.
|
* These are the version patterns found in the filenames of the various artifact's versions IDs.
|
||||||
* These patterns are all tackling lowercase version IDs.
|
* These patterns are all tackling lowercase version IDs.
|
||||||
*/
|
*/
|
||||||
private static final String versionPatterns[] = new String[] {
|
private static final String versionPatterns[] =
|
||||||
"([0-9][_.0-9a-z]*)",
|
new String[]{ "([0-9][_.0-9a-z]*)", "(snapshot)", "(g?[_.0-9ab]*(pre|rc|g|m)[_.0-9]*)", "(dev[_.0-9]*)",
|
||||||
"(snapshot)",
|
"(alpha[_.0-9]*)", "(beta[_.0-9]*)", "(rc[_.0-9]*)",
|
||||||
"(g?[_.0-9ab]*(pre|rc|g|m)[_.0-9]*)",
|
|
||||||
"(dev[_.0-9]*)",
|
|
||||||
"(alpha[_.0-9]*)",
|
|
||||||
"(beta[_.0-9]*)",
|
|
||||||
"(rc[_.0-9]*)",
|
|
||||||
// "(test[_.0-9]*)", -- omitted for MRM-681, can be reinstated as part of MRM-712
|
// "(test[_.0-9]*)", -- omitted for MRM-681, can be reinstated as part of MRM-712
|
||||||
"(debug[_.0-9]*)",
|
"(debug[_.0-9]*)", "(unofficial[_.0-9]*)", "(current)", "(latest)", "(fcs)", "(release[_.0-9]*)",
|
||||||
"(unofficial[_.0-9]*)",
|
"(nightly)", "(final)", "(incubating)", "(incubator)", "([ab][_.0-9]+)" };
|
||||||
"(current)",
|
|
||||||
"(latest)",
|
|
||||||
"(fcs)",
|
|
||||||
"(release[_.0-9]*)",
|
|
||||||
"(nightly)",
|
|
||||||
"(final)",
|
|
||||||
"(incubating)",
|
|
||||||
"(incubator)",
|
|
||||||
"([ab][_.0-9]+)" };
|
|
||||||
|
|
||||||
public static final String SNAPSHOT = "SNAPSHOT";
|
public static final String SNAPSHOT = "SNAPSHOT";
|
||||||
|
|
||||||
|
@ -64,13 +50,14 @@ public class VersionUtil
|
||||||
|
|
||||||
public static final Pattern GENERIC_SNAPSHOT_PATTERN = Pattern.compile( "^(.*)-" + SNAPSHOT );
|
public static final Pattern GENERIC_SNAPSHOT_PATTERN = Pattern.compile( "^(.*)-" + SNAPSHOT );
|
||||||
|
|
||||||
private static final Pattern VERSION_MEGA_PATTERN = Pattern.compile( StringUtils.join( versionPatterns, '|' ), Pattern.CASE_INSENSITIVE );
|
private static final Pattern VERSION_MEGA_PATTERN =
|
||||||
|
Pattern.compile( StringUtils.join( versionPatterns, '|' ), Pattern.CASE_INSENSITIVE );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Tests if the unknown string contains elements that identify it as a version string (or not).
|
* Tests if the unknown string contains elements that identify it as a version string (or not).
|
||||||
* </p>
|
* </p>
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* <p>
|
||||||
* The algorithm tests each part of the string that is delimited by a '-' (dash) character.
|
* The algorithm tests each part of the string that is delimited by a '-' (dash) character.
|
||||||
* If 75% or more of the sections are identified as 'version' strings, the result is
|
* If 75% or more of the sections are identified as 'version' strings, the result is
|
||||||
|
@ -115,7 +102,7 @@ public class VersionUtil
|
||||||
* <p>
|
* <p>
|
||||||
* Tests if the identifier is a known simple version keyword.
|
* Tests if the identifier is a known simple version keyword.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* <p>
|
||||||
* This method is different from {@link #isVersion(String)} in that it tests the whole input string in
|
* This method is different from {@link #isVersion(String)} in that it tests the whole input string in
|
||||||
* one go as a simple identifier. (eg "alpha", "1.0", "beta", "debug", "latest", "rc#", etc...)
|
* one go as a simple identifier. (eg "alpha", "1.0", "beta", "debug", "latest", "rc#", etc...)
|
||||||
|
@ -140,7 +127,7 @@ public class VersionUtil
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return isGenericSnapshot(version);
|
return isGenericSnapshot( version );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +148,7 @@ public class VersionUtil
|
||||||
* <p>
|
* <p>
|
||||||
* Get the release version of the snapshot version.
|
* Get the release version of the snapshot version.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* <p>
|
||||||
* If snapshot version is 1.0-SNAPSHOT, then release version would be 1.0
|
* If snapshot version is 1.0-SNAPSHOT, then release version would be 1.0
|
||||||
* And if snapshot version is 1.0-20070113.163208-1.jar, then release version would still be 1.0
|
* And if snapshot version is 1.0-20070113.163208-1.jar, then release version would still be 1.0
|
||||||
|
@ -174,7 +161,7 @@ public class VersionUtil
|
||||||
{
|
{
|
||||||
Matcher m = UNIQUE_SNAPSHOT_PATTERN.matcher( snapshotVersion );
|
Matcher m = UNIQUE_SNAPSHOT_PATTERN.matcher( snapshotVersion );
|
||||||
|
|
||||||
if( isGenericSnapshot( snapshotVersion ) )
|
if ( isGenericSnapshot( snapshotVersion ) )
|
||||||
{
|
{
|
||||||
m = GENERIC_SNAPSHOT_PATTERN.matcher( snapshotVersion );
|
m = GENERIC_SNAPSHOT_PATTERN.matcher( snapshotVersion );
|
||||||
}
|
}
|
||||||
|
@ -192,7 +179,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() )
|
if ( m.matches() )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue