Class DefaultTransport

java.lang.Object
org.apache.maven.internal.impl.DefaultTransport
All Implemented Interfaces:
Closeable, AutoCloseable, Transport

public class DefaultTransport extends Object implements Transport
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final URI
     
    private final org.eclipse.aether.spi.connector.transport.Transporter
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultTransport(URI baseURI, org.eclipse.aether.spi.connector.transport.Transporter transporter)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    boolean
    get(URI relativeSource, Path target)
    GETs the source URI content into target (does not have to exist, or will be overwritten if exist).
    Optional<byte[]>
    getBytes(URI relativeSource)
    GETs the source URI content as byte array.
    getString(URI relativeSource, Charset charset)
    GETs the source URI content as string.
    void
    put(Path source, URI relativeTarget)
    PUTs the source file (must exist as file) to target URI.
    void
    putBytes(byte[] source, URI relativeTarget)
    PUTs the source byte array to target URI.
    void
    putString(String source, Charset charset, URI relativeTarget)
    PUTs the source string to target URI.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.maven.api.services.Transport

    getString, putString
  • Field Details

    • baseURI

      private final URI baseURI
    • transporter

      private final org.eclipse.aether.spi.connector.transport.Transporter transporter
  • Constructor Details

    • DefaultTransport

      public DefaultTransport(URI baseURI, org.eclipse.aether.spi.connector.transport.Transporter transporter)
  • Method Details

    • get

      public boolean get(URI relativeSource, Path target)
      Description copied from interface: Transport
      GETs the source URI content into target (does not have to exist, or will be overwritten if exist). The source MUST BE relative from the RemoteRepository.getUrl() root.
      Specified by:
      get in interface Transport
      Returns:
      true if operation succeeded, false if source does not exist.
    • getBytes

      public Optional<byte[]> getBytes(URI relativeSource)
      Description copied from interface: Transport
      GETs the source URI content as byte array. The source MUST BE relative from the RemoteRepository.getUrl() root.
      Specified by:
      getBytes in interface Transport
      Returns:
      the byte array if operation succeeded, null if source does not exist.
    • getString

      public Optional<String> getString(URI relativeSource, Charset charset)
      Description copied from interface: Transport
      GETs the source URI content as string. The source MUST BE relative from the RemoteRepository.getUrl() root.
      Specified by:
      getString in interface Transport
      Returns:
      the string if operation succeeded, null if source does not exist.
    • put

      public void put(Path source, URI relativeTarget)
      Description copied from interface: Transport
      PUTs the source file (must exist as file) to target URI. The target MUST BE relative from the RemoteRepository.getUrl() root.
      Specified by:
      put in interface Transport
    • putBytes

      public void putBytes(byte[] source, URI relativeTarget)
      Description copied from interface: Transport
      PUTs the source byte array to target URI. The target MUST BE relative from the RemoteRepository.getUrl() root.
      Specified by:
      putBytes in interface Transport
    • putString

      public void putString(String source, Charset charset, URI relativeTarget)
      Description copied from interface: Transport
      PUTs the source string to target URI. The target MUST BE relative from the RemoteRepository.getUrl() root.
      Specified by:
      putString in interface Transport
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable