Application Programmer Interfact (API)

Artifacts

The Avalon Repository API provides support for the notion of an Artifact. An artifact is a logical reference to a physical resource. A repository implementation is reponsible for the establishment of a concrete URL relative to a logical artifact reference.

The following code fragment demonstrates the creation of an artifact reference. In this example we are creating a reference using the Maven group/name/version semantics.

Artifact artifact = 
    ClassicArtifact.createJarArtifact( 
      "avalon-framework", "avalon-framework-api", "4.1.5" );

Once an artifact has been created the repository is used to to resolve the artifact to a concrete url. The actual url returned to the client will have a transport protocol and path adapted to the underlying repository type (e.g. HTTP, LDAP, etc.).

URL url = m_repository.getResource( artifact );