Class M1GavCalculator

  • All Implemented Interfaces:
    GavCalculator

    @Singleton
    @Named("maven1")
    public class M1GavCalculator
    extends java.lang.Object
    implements GavCalculator
    An M1 GavCalculator. Heavily under-maintained.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.regex.Pattern PAT1  
      private static java.util.regex.Pattern PAT2  
    • Constructor Summary

      Constructors 
      Constructor Description
      M1GavCalculator()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String gavToPath​(Gav gav)
      // XXX this is not accurate, m1 is using packaging as an artifact folder name.
      Gav pathToGav​(java.lang.String str)
      Calculates GAV from provided repository path.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PAT1

        private static final java.util.regex.Pattern PAT1
      • PAT2

        private static final java.util.regex.Pattern PAT2
    • Constructor Detail

      • M1GavCalculator

        public M1GavCalculator()
    • Method Detail

      • pathToGav

        public Gav pathToGav​(java.lang.String str)
        Description copied from interface: GavCalculator
        Calculates GAV from provided repository path. The path has to be absolute starting from repository root. If path represents a proper artifact path (conforming to given layout), GAV is "calculated" from it and is returned. If path represents some file that is not an artifact, but is part of the repository layout (like maven-metadata.xml), or in any other case it returns null.
        Specified by:
        pathToGav in interface GavCalculator
        Parameters:
        str - the repository path
        Returns:
        Gav parsed from the path
      • gavToPath

        public java.lang.String gavToPath​(Gav gav)
        // XXX this is not accurate, m1 is using packaging as an artifact folder name.
        Specified by:
        gavToPath in interface GavCalculator
        Returns:
        the path calculated from GAV, obeying current layout.
        See Also:
        org.apache.maven.artifact.repository.layout.LegacyRepositoryLayout#pathOf(org.apache.maven.artifact.Artifact), org.apache.maven.artifact.handler.DefaultArtifactHandler#getDirectory()