Class MavenMetadata


  • public class MavenMetadata
    extends java.lang.Object
    Simple parser for maven-metadata.xml files
    • Constructor Detail

      • MavenMetadata

        public MavenMetadata​(java.nio.file.Path metadataXml)
                      throws java.io.IOException,
                             javax.xml.parsers.ParserConfigurationException,
                             org.xml.sax.SAXException
        Throws:
        java.io.IOException
        javax.xml.parsers.ParserConfigurationException
        org.xml.sax.SAXException
    • Method Detail

      • getGroupId

        public java.lang.String getGroupId()
      • getArtifactId

        public java.lang.String getArtifactId()
      • getVersion

        public java.lang.String getVersion()
      • getLastUpdated

        public java.lang.String getLastUpdated()
      • getSnapshotTimestamp

        public java.lang.String getSnapshotTimestamp()
      • getSnapshotBuildNumber

        public java.lang.String getSnapshotBuildNumber()
      • getSnapshot

        public MavenMetadata.Snapshot getSnapshot​(java.lang.String classifier,
                                                  java.lang.String extension)
      • isExpiredTimestamp

        public static boolean isExpiredTimestamp​(java.lang.String lastUpdated)
        Tests the current time against the provided timestamp.

        If the current time is the next day from the provided timestamp, it is considered expired.

        Parameters:
        lastUpdated - the time representing the last update
        Returns:
        true if it's the next day from the timestamp (or later)