Class Mirror

All Implemented Interfaces:
Serializable, InputLocationTracker

A download mirror for a given repository.
See Also:
  • Constructor Details

  • Method Details

    • getMirrorOf

      public String getMirrorOf()
      A repository id or (since Maven 2.0.9) an expression matching one or many repository ids to mirror, e.g., central or *,!repo1. * (since Maven 2.0.5), external:* (since Maven 2.0.9) and external:http:* (since Maven 3.8.0) have a special meaning: see Mirror Settings guide.
      Returns:
      a String
    • getName

      public String getName()
      The optional name that describes the mirror.
      Returns:
      a String
    • getUrl

      public String getUrl()
      The URL of the mirror repository.
      Returns:
      a String
    • getLayout

      public String getLayout()
      The layout of the mirror repository.
      Returns:
      a String
      Since:
      Maven 3.
    • getMirrorOfLayouts

      public String getMirrorOfLayouts()
      The layouts of repositories being mirrored. This value can be used to restrict the usage of the mirror to repositories with a matching layout (apart from a matching id).
      Returns:
      a String
      Since:
      Maven 3.
    • isBlocked

      public boolean isBlocked()
      Whether this mirror should be blocked from any download request but fail the download process, explaining why.
      Default value is: false
      Since: Maven 3.8.0
      Returns:
      a boolean
    • getLocation

      public InputLocation getLocation(Object key)
      Gets the location of the specified field in the input source.
      Specified by:
      getLocation in interface InputLocationTracker
      Overrides:
      getLocation in class IdentifiableBase
    • getLocationKeys

      public Set<Object> getLocationKeys()
      Gets the keys of the locations of the input source.
      Overrides:
      getLocationKeys in class IdentifiableBase
    • with

      @Nonnull public Mirror.Builder with()
      Creates a new builder with this object as the basis.
      Overrides:
      with in class IdentifiableBase
      Returns:
      a Builder
    • withId

      @Nonnull public Mirror withId(String id)
      Creates a new Mirror instance using the specified id.
      Overrides:
      withId in class IdentifiableBase
      Parameters:
      id - the new String to use
      Returns:
      a Mirror with the specified id
    • withMirrorOf

      @Nonnull public Mirror withMirrorOf(String mirrorOf)
      Creates a new Mirror instance using the specified mirrorOf.
      Parameters:
      mirrorOf - the new String to use
      Returns:
      a Mirror with the specified mirrorOf
    • withName

      @Nonnull public Mirror withName(String name)
      Creates a new Mirror instance using the specified name.
      Parameters:
      name - the new String to use
      Returns:
      a Mirror with the specified name
    • withUrl

      @Nonnull public Mirror withUrl(String url)
      Creates a new Mirror instance using the specified url.
      Parameters:
      url - the new String to use
      Returns:
      a Mirror with the specified url
    • withLayout

      @Nonnull public Mirror withLayout(String layout)
      Creates a new Mirror instance using the specified layout.
      Parameters:
      layout - the new String to use
      Returns:
      a Mirror with the specified layout
    • withMirrorOfLayouts

      @Nonnull public Mirror withMirrorOfLayouts(String mirrorOfLayouts)
      Creates a new Mirror instance using the specified mirrorOfLayouts.
      Parameters:
      mirrorOfLayouts - the new String to use
      Returns:
      a Mirror with the specified mirrorOfLayouts
    • withBlocked

      @Nonnull public Mirror withBlocked(boolean blocked)
      Creates a new Mirror instance using the specified blocked.
      Parameters:
      blocked - the new boolean to use
      Returns:
      a Mirror with the specified blocked
    • newInstance

      @Nonnull public static Mirror newInstance()
      Creates a new Mirror instance. Equivalent to newInstance(true).
      Returns:
      a new Mirror
      See Also:
    • newInstance

      @Nonnull public static Mirror newInstance(boolean withDefaults)
      Creates a new Mirror instance using default values or not. Equivalent to newBuilder(withDefaults).build().
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Mirror
    • newBuilder

      @Nonnull public static Mirror.Builder newBuilder()
      Creates a new Mirror builder instance. Equivalent to newBuilder(true).
      Returns:
      a new Builder
      See Also:
    • newBuilder

      @Nonnull public static Mirror.Builder newBuilder(boolean withDefaults)
      Creates a new Mirror builder instance using default values or not.
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static Mirror.Builder newBuilder(Mirror from)
      Creates a new Mirror builder instance using the specified object as a basis. Equivalent to newBuilder(from, false).
      Parameters:
      from - the Mirror instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static Mirror.Builder newBuilder(Mirror from, boolean forceCopy)
      Creates a new Mirror builder instance using the specified object as a basis.
      Parameters:
      from - the Mirror instance to use as a basis
      forceCopy - the boolean indicating if a copy should be forced
      Returns:
      a new Builder
    • toString

      public String toString()
      Overrides:
      toString in class Object