|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.maven.archiva.common.utils.VersionUtil
public class VersionUtil
Version utility methods.
Field Summary | |
---|---|
static java.util.regex.Pattern |
GENERIC_SNAPSHOT_PATTERN
|
static java.lang.String |
SNAPSHOT
|
static java.util.regex.Pattern |
TIMESTAMP_PATTERN
|
static java.util.regex.Pattern |
UNIQUE_SNAPSHOT_PATTERN
|
Constructor Summary | |
---|---|
VersionUtil()
|
Method Summary | |
---|---|
static java.lang.String |
getBaseVersion(java.lang.String version)
|
static java.lang.String |
getReleaseVersion(java.lang.String snapshotVersion)
Get the release version of the snapshot version. |
static boolean |
isGenericSnapshot(java.lang.String version)
|
static boolean |
isSimpleVersionKeyword(java.lang.String identifier)
Tests if the identifier is a known simple version keyword. |
static boolean |
isSnapshot(java.lang.String version)
|
static boolean |
isUniqueSnapshot(java.lang.String version)
|
static boolean |
isVersion(java.lang.String unknown)
Tests if the unknown string contains elements that identify it as a version string (or not). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SNAPSHOT
public static final java.util.regex.Pattern UNIQUE_SNAPSHOT_PATTERN
public static final java.util.regex.Pattern TIMESTAMP_PATTERN
public static final java.util.regex.Pattern GENERIC_SNAPSHOT_PATTERN
Constructor Detail |
---|
public VersionUtil()
Method Detail |
---|
public static boolean isVersion(java.lang.String unknown)
Tests if the unknown string contains elements that identify it as a version string (or not).
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 determined to be of a high probability to be version identifier string.
unknown
- the unknown string to test.
public static boolean isSimpleVersionKeyword(java.lang.String identifier)
Tests if the identifier is a known simple version keyword.
This method is different from 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...)
identifier
- the identifier to test.
public static boolean isSnapshot(java.lang.String version)
public static java.lang.String getBaseVersion(java.lang.String version)
public static java.lang.String getReleaseVersion(java.lang.String snapshotVersion)
Get the release version of the snapshot version.
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
snapshotVersion
-
public static boolean isUniqueSnapshot(java.lang.String version)
public static boolean isGenericSnapshot(java.lang.String version)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |