Class LocalRepository

  • All Implemented Interfaces:
    ArtifactRepository

    public final class LocalRepository
    extends java.lang.Object
    implements ArtifactRepository
    A repository on the local file system used to cache contents of remote repositories and to store locally installed artifacts. Note that this class merely describes such a repository, actual access to the contained artifacts is handled by a LocalRepositoryManager which is usually determined from the type of the repository.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.File basedir  
      private java.lang.String type  
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalRepository​(java.io.File basedir)
      Creates a new local repository with the specified base directory and unknown type.
      LocalRepository​(java.io.File basedir, java.lang.String type)
      Creates a new local repository with the specified properties.
      LocalRepository​(java.lang.String basedir)
      Creates a new local repository with the specified base directory and unknown type.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.io.File getBasedir()
      Gets the base directory of the repository.
      java.lang.String getContentType()
      Gets the type of the repository, for example "default".
      java.lang.String getId()
      Gets the identifier of this repository.
      private static int hash​(java.lang.Object obj)  
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • basedir

        private final java.io.File basedir
      • type

        private final java.lang.String type
    • Constructor Detail

      • LocalRepository

        public LocalRepository​(java.lang.String basedir)
        Creates a new local repository with the specified base directory and unknown type.
        Parameters:
        basedir - The base directory of the repository, may be null.
      • LocalRepository

        public LocalRepository​(java.io.File basedir)
        Creates a new local repository with the specified base directory and unknown type.
        Parameters:
        basedir - The base directory of the repository, may be null.
      • LocalRepository

        public LocalRepository​(java.io.File basedir,
                               java.lang.String type)
        Creates a new local repository with the specified properties.
        Parameters:
        basedir - The base directory of the repository, may be null.
        type - The type of the repository, may be null.
    • Method Detail

      • getContentType

        public java.lang.String getContentType()
        Description copied from interface: ArtifactRepository
        Gets the type of the repository, for example "default".
        Specified by:
        getContentType in interface ArtifactRepository
        Returns:
        The (case-sensitive) type of the repository, never null.
      • getId

        public java.lang.String getId()
        Description copied from interface: ArtifactRepository
        Gets the identifier of this repository.
        Specified by:
        getId in interface ArtifactRepository
        Returns:
        The (case-sensitive) identifier, never null.
      • getBasedir

        public java.io.File getBasedir()
        Gets the base directory of the repository.
        Returns:
        The base directory or null if none.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • hash

        private static int hash​(java.lang.Object obj)