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
FieldsFields 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, transferEventSupportFields inherited from interface org.apache.maven.wagon.Wagon
DEFAULT_CONNECTION_TIMEOUT, DEFAULT_READ_TIMEOUT, ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intprotected voidcleanupGetTransfer(org.apache.maven.wagon.resource.Resource resource) voidprotected org.apache.http.client.methods.CloseableHttpResponseexecute(org.apache.http.client.methods.HttpUriRequest httpMethod) voidfillInputData(org.apache.maven.wagon.InputData inputData) voidfillOutputData(org.apache.maven.wagon.OutputData outputData) protected org.apache.http.client.AuthCacheGet the override values for standard HttpClient AuthScopeprotected org.apache.http.client.CredentialsProviderstatic org.apache.http.impl.client.CloseableHttpClientintstatic intGet the override values for proxy HttpClient AuthScopeprotected StringgetURL(org.apache.maven.wagon.repository.Repository repository) getUrl Implementors can override this to remove unwanted parts of the url such as role-hintsprotected StringgetUserAgent(org.apache.http.client.methods.HttpUriRequest method) protected voidvoidvoidvoidputFromStream(InputStream stream, String destination) voidputFromStream(InputStream stream, String destination, long contentLength, long lastModified) protected voidputFromStream(InputStream stream, org.apache.maven.wagon.resource.Resource resource) booleanresourceExists(String resourceName) voidsetBasicAuthScope(BasicAuthScope basicAuth) Set the override values for standard HttpClient AuthScopevoidsetHeaders(org.apache.http.client.methods.HttpUriRequest method) voidsetHttpConfiguration(HttpConfiguration httpConfiguration) voidsetHttpHeaders(Properties httpHeaders) voidsetInitialBackoffSeconds(int initialBackoffSeconds) static voidsetPersistentPool(boolean persistent) static voidsetPoolingHttpClientConnectionManager(org.apache.http.impl.conn.PoolingHttpClientConnectionManager poolingHttpClientConnectionManager) voidsetProxyBasicAuthScope(BasicAuthScope proxyAuth) Set the override values for proxy HttpClient AuthScopeMethods inherited from class org.apache.maven.wagon.StreamWagon
checkInputStream, checkOutputStream, get, getIfNewer, getIfNewerToStream, getInputStream, getOutputStream, getToStreamMethods 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, transferMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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_REQUESTSSee 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:
InterruptedExceptionorg.apache.maven.wagon.TransferFailedException
-
openConnectionInternal
public void openConnectionInternal()- Specified by:
openConnectionInternalin classorg.apache.maven.wagon.AbstractWagon
-
closeConnection
public void closeConnection()- Specified by:
closeConnectionin classorg.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:
putin interfaceorg.apache.maven.wagon.Wagon- Overrides:
putin classorg.apache.maven.wagon.StreamWagon- Throws:
org.apache.maven.wagon.TransferFailedExceptionorg.apache.maven.wagon.ResourceDoesNotExistExceptionorg.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:
putFromStreamin interfaceorg.apache.maven.wagon.StreamingWagon- Overrides:
putFromStreamin classorg.apache.maven.wagon.StreamWagon- Throws:
org.apache.maven.wagon.TransferFailedExceptionorg.apache.maven.wagon.ResourceDoesNotExistExceptionorg.apache.maven.wagon.authorization.AuthorizationException
-
mkdirs
- Throws:
org.apache.http.HttpExceptionIOException
-
resourceExists
public boolean resourceExists(String resourceName) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.authorization.AuthorizationException - Specified by:
resourceExistsin interfaceorg.apache.maven.wagon.Wagon- Overrides:
resourceExistsin classorg.apache.maven.wagon.AbstractWagon- Throws:
org.apache.maven.wagon.TransferFailedExceptionorg.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.HttpExceptionIOException
-
setHeaders
public void setHeaders(org.apache.http.client.methods.HttpUriRequest method) -
getUserAgent
-
getURL
getUrl Implementors can override this to remove unwanted parts of the url such as role-hints- Parameters:
repository-- Returns:
-
getHttpConfiguration
-
getBasicAuthScope
Get the override values for standard HttpClient AuthScope- Returns:
- the basicAuth
-
getProxyBasicAuthScope
Get the override values for proxy HttpClient AuthScope- Returns:
- the proxyAuth
-
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:
fillInputDatain classorg.apache.maven.wagon.StreamWagon- Throws:
org.apache.maven.wagon.TransferFailedExceptionorg.apache.maven.wagon.ResourceDoesNotExistExceptionorg.apache.maven.wagon.authorization.AuthorizationException
-
cleanupGetTransfer
protected void cleanupGetTransfer(org.apache.maven.wagon.resource.Resource resource) - Overrides:
cleanupGetTransferin classorg.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:
putFromStreamin interfaceorg.apache.maven.wagon.StreamingWagon- Overrides:
putFromStreamin classorg.apache.maven.wagon.StreamWagon- Throws:
org.apache.maven.wagon.TransferFailedExceptionorg.apache.maven.wagon.ResourceDoesNotExistExceptionorg.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:
putFromStreamin classorg.apache.maven.wagon.StreamWagon- Throws:
org.apache.maven.wagon.TransferFailedExceptionorg.apache.maven.wagon.authorization.AuthorizationExceptionorg.apache.maven.wagon.ResourceDoesNotExistException
-
getHttpHeaders
-
setHttpHeaders
-
fillOutputData
public void fillOutputData(org.apache.maven.wagon.OutputData outputData) throws org.apache.maven.wagon.TransferFailedException - Specified by:
fillOutputDatain classorg.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()
-