public class Parser extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
FILE_SEPARATOR
Final artifact path separator.
|
static String |
VERSION_LATEST
Default version if none present in the url.
|
| Constructor and Description |
|---|
Parser(String path)
Creates a new protocol parser.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getArtifact()
Returns the artifact id.
|
String |
getArtifactLocalMetdataPath()
Returns the complete path to artifact local metadata file.
|
String |
getArtifactMetdataPath()
Returns the complete path to artifact metadata file.
|
String |
getArtifactPath()
Returns the complete path to artifact as stated by Maven 2 repository layout.
|
String |
getArtifactPath(String version)
Returns the complete path to artifact as stated by Maven 2 repository layout.
|
String |
getClassifier()
Returns the artifact classifier.
|
String |
getGroup()
Returns the group id of the artifact.
|
String |
getRepositoryURL()
Returns the repository URL if present, null otherwise
|
String |
getSnapshotPath(String version,
String timestamp,
String buildnumber)
Returns the complete path to artifact for a snapshot file.
|
String |
getSnapshotVersion(String version,
String timestamp,
String buildnumber)
Returns the version for an artifact for a snapshot version.
|
String |
getType()
Returns the artifact type.
|
String |
getVersion()
Returns the artifact version.
|
String |
getVersionLocalMetadataPath(String version)
Returns the path to local metdata file corresponding to this artifact version.
|
String |
getVersionMetadataPath(String version)
Returns the path to metdata file corresponding to this artifact version.
|
static String |
pathFromMaven(String uri)
Returns the artifact path from the given maven uri.
|
static String |
pathToMaven(String location) |
static String |
pathToMaven(String location,
Map parts) |
public static final String VERSION_LATEST
public static final String FILE_SEPARATOR
public Parser(String path) throws MalformedURLException
path - the path part of the url (without starting mvn:)MalformedURLException - if provided path does not comply to expected syntax or an malformed repository URLpublic static String pathFromMaven(String uri) throws MalformedURLException
uri - the maven uriMalformedURLExceptionpublic String getRepositoryURL()
public String getGroup()
public String getArtifact()
public String getVersion()
public String getType()
public String getClassifier()
public String getArtifactPath()
public String getArtifactPath(String version)
version - The version of the artifact.public String getSnapshotVersion(String version, String timestamp, String buildnumber)
version - The version of the snapshot.timestamp - The timestamp of the snapshot.buildnumber - The buildnumber of the snapshot.public String getSnapshotPath(String version, String timestamp, String buildnumber)
version - The version of the snapshot.timestamp - The timestamp of the snapshot.buildnumber - The buildnumber of the snapshot.public String getVersionMetadataPath(String version)
version - The version of the the metadata.public String getVersionLocalMetadataPath(String version)
version - The version of the the metadata.public String getArtifactLocalMetdataPath()
public String getArtifactMetdataPath()
Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.