Interface RepositoryLayoutFactory

All Known Implementing Classes:
Maven2RepositoryLayoutFactory

public interface RepositoryLayoutFactory
A factory to obtain repository layouts. A repository layout is responsible to map an artifact or some metadata to a URI relative to the repository root where the resource resides. When the repository system needs to access a given remote repository, it iterates the registered factories in descending order of their priority and calls newInstance(RepositorySystemSession, RemoteRepository) on them. The first layout returned by a factory will then be used for transferring artifacts/metadata.
  • Method Details

    • newInstance

      Tries to create a repository layout for the specified remote repository. Typically, a factory will inspect RemoteRepository.getContentType() to determine whether it can handle a repository.
      Parameters:
      session - The repository system session from which to configure the layout, must not be null.
      repository - The remote repository to create a layout for, must not be null.
      Returns:
      The layout for the given repository, never null.
      Throws:
      NoRepositoryLayoutException - If the factory cannot create a repository layout for the specified remote repository.
    • getPriority

      float getPriority()
      The priority of this factory. When multiple factories can handle a given repository, factories with higher priority are preferred over those with lower priority.
      Returns:
      The priority of this factory.