Package org.ops4j.pax.url.mvn.internal
Class Parser
- java.lang.Object
-
- org.ops4j.pax.url.mvn.internal.Parser
-
public class Parser extends Object
Parser for mvn: protocol.- Since:
- August 10, 2007
- Author:
- Alin Dreghiciu, Toni Menzel
- See Also:
Connection
-
-
Field Summary
Fields Modifier and Type Field Description static StringFILE_SEPARATORFinal artifact path separator.static StringVERSION_LATESTDefault version if none present in the url.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetArtifact()Returns the artifact id.StringgetArtifactLocalMetdataPath()Returns the complete path to artifact local metadata file.StringgetArtifactMetdataPath()Returns the complete path to artifact metadata file.StringgetArtifactPath()Returns the complete path to artifact as stated by Maven 2 repository layout.StringgetArtifactPath(String version)Returns the complete path to artifact as stated by Maven 2 repository layout.StringgetClassifier()Returns the artifact classifier.StringgetGroup()Returns the group id of the artifact.MavenRepositoryURLgetRepositoryURL()Returns the repository URL if present, null otherwiseStringgetSnapshotPath(String version, String timestamp, String buildnumber)Returns the complete path to artifact for a snapshot file.StringgetSnapshotVersion(String version, String timestamp, String buildnumber)Returns the version for an artifact for a snapshot version.StringgetType()Returns the artifact type.StringgetVersion()Returns the artifact version.StringgetVersionLocalMetadataPath(String version)Returns the path to local metdata file corresponding to this artifact version.StringgetVersionMetadataPath(String version)Returns the path to metdata file corresponding to this artifact version.
-
-
-
Field Detail
-
VERSION_LATEST
public static final String VERSION_LATEST
Default version if none present in the url.- See Also:
- Constant Field Values
-
FILE_SEPARATOR
public static final String FILE_SEPARATOR
Final artifact path separator.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Parser
public Parser(String path) throws MalformedURLException
Creates a new protocol parser.- Parameters:
path- the path part of the url (without starting mvn:)- Throws:
MalformedURLException- if provided path does not comply to expected syntax or an malformed repository URL
-
-
Method Detail
-
getRepositoryURL
public MavenRepositoryURL getRepositoryURL()
Returns the repository URL if present, null otherwise- Returns:
- repository URL
-
getGroup
public String getGroup()
Returns the group id of the artifact.- Returns:
- group Id
-
getArtifact
public String getArtifact()
Returns the artifact id.- Returns:
- artifact id
-
getVersion
public String getVersion()
Returns the artifact version.- Returns:
- version
-
getType
public String getType()
Returns the artifact type.- Returns:
- type
-
getClassifier
public String getClassifier()
Returns the artifact classifier.- Returns:
- classifier
-
getArtifactPath
public String getArtifactPath()
Returns the complete path to artifact as stated by Maven 2 repository layout.- Returns:
- artifact path
-
getArtifactPath
public String getArtifactPath(String version)
Returns the complete path to artifact as stated by Maven 2 repository layout.- Parameters:
version- The version of the artifact.- Returns:
- artifact path
-
getSnapshotVersion
public String getSnapshotVersion(String version, String timestamp, String buildnumber)
Returns the version for an artifact for a snapshot version.- Parameters:
version- The version of the snapshot.timestamp- The timestamp of the snapshot.buildnumber- The buildnumber of the snapshot.- Returns:
- artifact path
-
getSnapshotPath
public String getSnapshotPath(String version, String timestamp, String buildnumber)
Returns the complete path to artifact for a snapshot file.- Parameters:
version- The version of the snapshot.timestamp- The timestamp of the snapshot.buildnumber- The buildnumber of the snapshot.- Returns:
- artifact path
-
getVersionMetadataPath
public String getVersionMetadataPath(String version)
Returns the path to metdata file corresponding to this artifact version.- Parameters:
version- The version of the the metadata.- Returns:
- metadata file path
-
getVersionLocalMetadataPath
public String getVersionLocalMetadataPath(String version)
Returns the path to local metdata file corresponding to this artifact version.- Parameters:
version- The version of the the metadata.- Returns:
- metadata file path
-
getArtifactLocalMetdataPath
public String getArtifactLocalMetdataPath()
Returns the complete path to artifact local metadata file.- Returns:
- artifact path
-
getArtifactMetdataPath
public String getArtifactMetdataPath()
Returns the complete path to artifact metadata file.- Returns:
- artifact path
-
-