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 intSC_TOO_MANY_REQUESTSSee RFC6585
-
Constructor Summary
Constructors Constructor Description AbstractHttpClientWagon()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intbackoff(int wait, java.lang.String url)protected voidcleanupGetTransfer(org.apache.maven.wagon.resource.Resource resource)voidcloseConnection()protected 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.AuthCachegetAuthCache()BasicAuthScopegetBasicAuthScope()Get the override values for standard HttpClient AuthScopeprotected org.apache.http.client.CredentialsProvidergetCredentialsProvider()static org.apache.http.impl.client.CloseableHttpClientgetHttpClient()HttpConfigurationgetHttpConfiguration()java.util.PropertiesgetHttpHeaders()intgetInitialBackoffSeconds()static intgetMaxBackoffWaitSeconds()BasicAuthScopegetProxyBasicAuthScope()Get the override values for proxy HttpClient AuthScopeprotected java.lang.StringgetURL(org.apache.maven.wagon.repository.Repository repository)getUrl Implementors can override this to remove unwanted parts of the url such as role-hintsprotected java.lang.StringgetUserAgent(org.apache.http.client.methods.HttpUriRequest method)protected voidmkdirs(java.lang.String dirname)voidopenConnectionInternal()voidput(java.io.File source, java.lang.String resourceName)voidputFromStream(java.io.InputStream stream, java.lang.String destination)voidputFromStream(java.io.InputStream stream, java.lang.String destination, long contentLength, long lastModified)protected voidputFromStream(java.io.InputStream stream, org.apache.maven.wagon.resource.Resource resource)booleanresourceExists(java.lang.String resourceName)voidsetBasicAuthScope(BasicAuthScope basicAuth)Set the override values for standard HttpClient AuthScopevoidsetHeaders(org.apache.http.client.methods.HttpUriRequest method)voidsetHttpConfiguration(HttpConfiguration httpConfiguration)voidsetHttpHeaders(java.util.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 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 Detail
-
SC_TOO_MANY_REQUESTS
protected static final int SC_TOO_MANY_REQUESTS
See RFC6585- See Also:
- Constant Field Values
-
-
Method Detail
-
backoff
protected int backoff(int wait, java.lang.String url) throws java.lang.InterruptedException, org.apache.maven.wagon.TransferFailedException- Throws:
java.lang.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(java.io.File source, java.lang.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(java.io.InputStream stream, java.lang.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
protected void mkdirs(java.lang.String dirname) throws org.apache.http.HttpException, java.io.IOException- Throws:
org.apache.http.HttpExceptionjava.io.IOException
-
resourceExists
public boolean resourceExists(java.lang.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, java.io.IOException- Throws:
org.apache.http.HttpExceptionjava.io.IOException
-
setHeaders
public void setHeaders(org.apache.http.client.methods.HttpUriRequest method)
-
getUserAgent
protected java.lang.String getUserAgent(org.apache.http.client.methods.HttpUriRequest method)
-
getURL
protected java.lang.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:
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(java.io.InputStream stream, java.lang.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(java.io.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
public java.util.Properties getHttpHeaders()
-
setHttpHeaders
public void setHttpHeaders(java.util.Properties httpHeaders)
-
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()
-
-