Class AbstractHttpClientWagon

java.lang.Object
org.apache.maven.wagon.AbstractWagon
org.apache.maven.wagon.StreamWagon
org.apache.maven.wagon.shared.http.AbstractHttpClientWagon
All Implemented Interfaces:
org.apache.maven.wagon.StreamingWagon, org.apache.maven.wagon.Wagon

public abstract class AbstractHttpClientWagon extends org.apache.maven.wagon.StreamWagon
Author:
Michal Maczka, James William Dumay
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final int
    See RFC6585

    Fields inherited from class org.apache.maven.wagon.AbstractWagon

    authenticationInfo, BUFFER_SEGMENT_SIZE, DEFAULT_BUFFER_SIZE, interactive, MAXIMUM_BUFFER_SIZE, MINIMUM_AMOUNT_OF_TRANSFER_CHUNKS, proxyInfo, repository, sessionEventSupport, transferEventSupport

    Fields inherited from interface org.apache.maven.wagon.Wagon

    DEFAULT_CONNECTION_TIMEOUT, DEFAULT_READ_TIMEOUT, ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected int
    backoff(int wait, String url)
     
    protected void
    cleanupGetTransfer(org.apache.maven.wagon.resource.Resource resource)
     
    void
     
    protected org.apache.http.client.methods.CloseableHttpResponse
    execute(org.apache.http.client.methods.HttpUriRequest httpMethod)
     
    void
    fillInputData(org.apache.maven.wagon.InputData inputData)
     
    void
    fillOutputData(org.apache.maven.wagon.OutputData outputData)
     
    protected org.apache.http.client.AuthCache
     
    Get the override values for standard HttpClient AuthScope
    protected org.apache.http.client.CredentialsProvider
     
    static org.apache.http.impl.client.CloseableHttpClient
     
     
     
    int
     
    static int
     
    Get the override values for proxy HttpClient AuthScope
    protected String
    getURL(org.apache.maven.wagon.repository.Repository repository)
    getUrl Implementors can override this to remove unwanted parts of the url such as role-hints
    protected String
    getUserAgent(org.apache.http.client.methods.HttpUriRequest method)
     
    protected void
    mkdirs(String dirname)
     
    void
     
    void
    put(File source, String resourceName)
     
    void
    putFromStream(InputStream stream, String destination)
     
    void
    putFromStream(InputStream stream, String destination, long contentLength, long lastModified)
     
    protected void
    putFromStream(InputStream stream, org.apache.maven.wagon.resource.Resource resource)
     
    boolean
    resourceExists(String resourceName)
     
    void
    Set the override values for standard HttpClient AuthScope
    void
    setHeaders(org.apache.http.client.methods.HttpUriRequest method)
     
    void
     
    void
     
    void
    setInitialBackoffSeconds(int initialBackoffSeconds)
     
    static void
    setPersistentPool(boolean persistent)
     
    static void
    setPoolingHttpClientConnectionManager(org.apache.http.impl.conn.PoolingHttpClientConnectionManager poolingHttpClientConnectionManager)
     
    void
    Set the override values for proxy HttpClient AuthScope

    Methods inherited from class org.apache.maven.wagon.StreamWagon

    checkInputStream, checkOutputStream, get, getIfNewer, getIfNewerToStream, getInputStream, getOutputStream, getToStream

    Methods inherited from class org.apache.maven.wagon.AbstractWagon

    addSessionListener, addTransferListener, cleanupPutTransfer, connect, connect, connect, connect, connect, connect, createParentDirectories, disconnect, finishGetTransfer, finishPutTransfer, fireGetCompleted, fireGetInitiated, fireGetStarted, firePutCompleted, firePutInitiated, firePutStarted, fireSessionConnectionRefused, fireSessionDebug, fireSessionDisconnected, fireSessionDisconnecting, fireSessionError, fireSessionLoggedIn, fireSessionLoggedOff, fireSessionOpened, fireSessionOpening, fireTransferDebug, fireTransferError, fireTransferProgress, getAuthenticationInfo, getBufferCapacityForTransfer, getFileList, getPath, getPermissionsOverride, getProxyInfo, getProxyInfo, getReadTimeout, getRepository, getSessionEventSupport, getTimeout, getTransfer, getTransfer, getTransfer, getTransfer, getTransfer, getTransfer, getTransferEventSupport, hasSessionListener, hasTransferListener, isInteractive, openConnection, postProcessListeners, putDirectory, putTransfer, putTransfer, removeSessionListener, removeTransferListener, setInteractive, setPermissionsOverride, setReadTimeout, setSessionEventSupport, setTimeout, setTransferEventSupport, supportsDirectoryCopy, transfer, transfer, transfer, transfer

    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.wagon.Wagon

    addSessionListener, addTransferListener, connect, connect, connect, connect, connect, connect, disconnect, getFileList, getReadTimeout, getRepository, getTimeout, hasSessionListener, hasTransferListener, isInteractive, openConnection, putDirectory, removeSessionListener, removeTransferListener, setInteractive, setReadTimeout, setTimeout, supportsDirectoryCopy
  • Field Details

    • SC_TOO_MANY_REQUESTS

      protected static final int SC_TOO_MANY_REQUESTS
      See RFC6585
      See Also:
  • Constructor Details

    • AbstractHttpClientWagon

      public AbstractHttpClientWagon()
  • Method Details

    • backoff

      protected int backoff(int wait, String url) throws InterruptedException, org.apache.maven.wagon.TransferFailedException
      Throws:
      InterruptedException
      org.apache.maven.wagon.TransferFailedException
    • openConnectionInternal

      public void openConnectionInternal()
      Specified by:
      openConnectionInternal in class org.apache.maven.wagon.AbstractWagon
    • closeConnection

      public void closeConnection()
      Specified by:
      closeConnection in class org.apache.maven.wagon.StreamWagon
    • getHttpClient

      public static org.apache.http.impl.client.CloseableHttpClient getHttpClient()
    • setPersistentPool

      public static void setPersistentPool(boolean persistent)
    • setPoolingHttpClientConnectionManager

      public static void setPoolingHttpClientConnectionManager(org.apache.http.impl.conn.PoolingHttpClientConnectionManager poolingHttpClientConnectionManager)
    • put

      public void put(File source, String resourceName) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.ResourceDoesNotExistException, org.apache.maven.wagon.authorization.AuthorizationException
      Specified by:
      put in interface org.apache.maven.wagon.Wagon
      Overrides:
      put in class org.apache.maven.wagon.StreamWagon
      Throws:
      org.apache.maven.wagon.TransferFailedException
      org.apache.maven.wagon.ResourceDoesNotExistException
      org.apache.maven.wagon.authorization.AuthorizationException
    • putFromStream

      public void putFromStream(InputStream stream, String destination, long contentLength, long lastModified) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.ResourceDoesNotExistException, org.apache.maven.wagon.authorization.AuthorizationException
      Specified by:
      putFromStream in interface org.apache.maven.wagon.StreamingWagon
      Overrides:
      putFromStream in class org.apache.maven.wagon.StreamWagon
      Throws:
      org.apache.maven.wagon.TransferFailedException
      org.apache.maven.wagon.ResourceDoesNotExistException
      org.apache.maven.wagon.authorization.AuthorizationException
    • mkdirs

      protected void mkdirs(String dirname) throws org.apache.http.HttpException, IOException
      Throws:
      org.apache.http.HttpException
      IOException
    • resourceExists

      public boolean resourceExists(String resourceName) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.authorization.AuthorizationException
      Specified by:
      resourceExists in interface org.apache.maven.wagon.Wagon
      Overrides:
      resourceExists in class org.apache.maven.wagon.AbstractWagon
      Throws:
      org.apache.maven.wagon.TransferFailedException
      org.apache.maven.wagon.authorization.AuthorizationException
    • execute

      protected org.apache.http.client.methods.CloseableHttpResponse execute(org.apache.http.client.methods.HttpUriRequest httpMethod) throws org.apache.http.HttpException, IOException
      Throws:
      org.apache.http.HttpException
      IOException
    • setHeaders

      public void setHeaders(org.apache.http.client.methods.HttpUriRequest method)
    • getUserAgent

      protected String getUserAgent(org.apache.http.client.methods.HttpUriRequest method)
    • getURL

      protected String getURL(org.apache.maven.wagon.repository.Repository repository)
      getUrl Implementors can override this to remove unwanted parts of the url such as role-hints
      Parameters:
      repository -
      Returns:
    • getHttpConfiguration

      public HttpConfiguration getHttpConfiguration()
    • setHttpConfiguration

      public void setHttpConfiguration(HttpConfiguration httpConfiguration)
    • getBasicAuthScope

      public BasicAuthScope getBasicAuthScope()
      Get the override values for standard HttpClient AuthScope
      Returns:
      the basicAuth
    • setBasicAuthScope

      public void setBasicAuthScope(BasicAuthScope basicAuth)
      Set the override values for standard HttpClient AuthScope
      Parameters:
      basicAuth - the AuthScope to set
    • getProxyBasicAuthScope

      public BasicAuthScope getProxyBasicAuthScope()
      Get the override values for proxy HttpClient AuthScope
      Returns:
      the proxyAuth
    • setProxyBasicAuthScope

      public void setProxyBasicAuthScope(BasicAuthScope proxyAuth)
      Set the override values for proxy HttpClient AuthScope
      Parameters:
      proxyAuth - the AuthScope to set
    • fillInputData

      public void fillInputData(org.apache.maven.wagon.InputData inputData) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.ResourceDoesNotExistException, org.apache.maven.wagon.authorization.AuthorizationException
      Specified by:
      fillInputData in class org.apache.maven.wagon.StreamWagon
      Throws:
      org.apache.maven.wagon.TransferFailedException
      org.apache.maven.wagon.ResourceDoesNotExistException
      org.apache.maven.wagon.authorization.AuthorizationException
    • cleanupGetTransfer

      protected void cleanupGetTransfer(org.apache.maven.wagon.resource.Resource resource)
      Overrides:
      cleanupGetTransfer in class org.apache.maven.wagon.AbstractWagon
    • putFromStream

      public void putFromStream(InputStream stream, String destination) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.ResourceDoesNotExistException, org.apache.maven.wagon.authorization.AuthorizationException
      Specified by:
      putFromStream in interface org.apache.maven.wagon.StreamingWagon
      Overrides:
      putFromStream in class org.apache.maven.wagon.StreamWagon
      Throws:
      org.apache.maven.wagon.TransferFailedException
      org.apache.maven.wagon.ResourceDoesNotExistException
      org.apache.maven.wagon.authorization.AuthorizationException
    • putFromStream

      protected void putFromStream(InputStream stream, org.apache.maven.wagon.resource.Resource resource) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.authorization.AuthorizationException, org.apache.maven.wagon.ResourceDoesNotExistException
      Overrides:
      putFromStream in class org.apache.maven.wagon.StreamWagon
      Throws:
      org.apache.maven.wagon.TransferFailedException
      org.apache.maven.wagon.authorization.AuthorizationException
      org.apache.maven.wagon.ResourceDoesNotExistException
    • getHttpHeaders

      public Properties getHttpHeaders()
    • setHttpHeaders

      public void setHttpHeaders(Properties httpHeaders)
    • fillOutputData

      public void fillOutputData(org.apache.maven.wagon.OutputData outputData) throws org.apache.maven.wagon.TransferFailedException
      Specified by:
      fillOutputData in class org.apache.maven.wagon.StreamWagon
      Throws:
      org.apache.maven.wagon.TransferFailedException
    • getCredentialsProvider

      protected org.apache.http.client.CredentialsProvider getCredentialsProvider()
    • getAuthCache

      protected org.apache.http.client.AuthCache getAuthCache()
    • getInitialBackoffSeconds

      public int getInitialBackoffSeconds()
    • setInitialBackoffSeconds

      public void setInitialBackoffSeconds(int initialBackoffSeconds)
    • getMaxBackoffWaitSeconds

      public static int getMaxBackoffWaitSeconds()