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()
Return the artifact id.
|
String |
getArtifactLocalMetdataPath()
Return the complete path to artifact local metadata file.
|
String |
getArtifactMetdataPath()
Return the complete path to artifact metadata file.
|
String |
getArtifactPath()
Return the complete path to artifact as stated by Maven 2 repository layout.
|
String |
getArtifactPath(String version)
Return the complete path to artifact as stated by Maven 2 repository layout.
|
String |
getClassifier()
Return the artifact classifier.
|
String |
getGroup()
Return the group id of the artifact.
|
String |
getRepositoryURL()
Return the repository URL if present, null otherwise.
|
String |
getSnapshotPath(String version,
String timestamp,
String buildnumber)
Return the complete path to artifact for a snapshot file.
|
String |
getSnapshotVersion(String version,
String timestamp,
String buildnumber)
Return the version for an artifact for a snapshot version.
|
String |
getType()
Return the artifact type.
|
String |
getVersion()
Return the artifact version.
|
String |
getVersionLocalMetadataPath(String version)
Return the path to local metadata file corresponding to this artifact version.
|
String |
getVersionMetadataPath(String version)
Return the path to metadata file corresponding to this artifact version.
|
static String |
pathFromMaven(String uri)
Return the artifact path from the given maven uri.
|
static String |
pathFromMaven(String uri,
String resolved) |
static String |
pathToMaven(String location) |
static String |
pathToMaven(String location,
Map parts) |
void |
setArtifact(String m_artifact)
Changes parsed artifact - to allow printing mvn: URI with changed artifactId
|
void |
setClassifier(String m_classifier)
Changes parsed classifier - to allow printing mvn: URI with changed classifier
|
void |
setGroup(String m_group)
Changes parsed group - to allow printing mvn: URI with changed groupId
|
void |
setType(String m_type)
Changes parsed type - to allow printing mvn: URI with changed type
|
void |
setVersion(String m_version)
Changes parsed version - to allow printing mvn: URI with changed version
|
String |
toMvnURI()
Prints parsed mvn: URI (after possible change of any component)
|
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 URI.MalformedURLException - in case of "bad" provided URL/URI.public static String pathFromMaven(String uri, String resolved) throws MalformedURLException
MalformedURLExceptionpublic String getRepositoryURL()
public String toMvnURI()
public String getGroup()
public String getArtifact()
public String getVersion()
public String getType()
public String getClassifier()
public void setGroup(String m_group)
m_group - public void setArtifact(String m_artifact)
m_artifact - public void setVersion(String m_version)
m_version - public void setType(String m_type)
m_type - public void setClassifier(String m_classifier)
m_classifier - 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–2019 The Apache Software Foundation. All rights reserved.