Class Parser


  • public class Parser
    extends Object
    Parser for mvn: protocol.
    Since:
    August 10, 2007
    Author:
    Alin Dreghiciu, Toni Menzel
    See Also:
    Connection
    • 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