org.apache.maven.index.artifact
Interface GavCalculator

All Known Implementing Classes:
M1GavCalculator, M2GavCalculator

public interface GavCalculator

An interface to calculate Gav based on provided artifact path and to calculate an artifact path from provided Gav.

Author:
Tamas Cservenak

Method Summary
 String gavToPath(Gav gav)
          Reassembles the repository path from the supplied GAV.
 Gav pathToGav(String path)
          Calculates GAV from provided repository path.
 

Method Detail

pathToGav

Gav pathToGav(String path)
              throws IllegalArtifactCoordinateException
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. TODO: some place for different levels of "validation"?

Parameters:
path - the repository path
Returns:
Gav parsed from the path
Throws:
IllegalArtifactCoordinateException - not throwing it anymore, here just for backward compatibility.

gavToPath

String gavToPath(Gav gav)
Reassembles the repository path from the supplied GAV. It will be an absolute path.

Parameters:
gav -
Returns:
the path calculated from GAV, obeying current layout.


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.