Class DefaultTransport

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

public class DefaultTransport extends Object implements Transport
  • 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