public abstract class AbstractHttpClientWagon extends StreamWagon
Modifier and Type | Field and Description |
---|---|
protected static int |
SC_TOO_MANY_REQUESTS
See RFC6585
|
authenticationInfo, BUFFER_SEGMENT_SIZE, DEFAULT_BUFFER_SIZE, interactive, MAXIMUM_BUFFER_SIZE, MINIMUM_AMOUNT_OF_TRANSFER_CHUNKS, proxyInfo, repository, sessionEventSupport, transferEventSupport
DEFAULT_CONNECTION_TIMEOUT, DEFAULT_READ_TIMEOUT, ROLE
Constructor and Description |
---|
AbstractHttpClientWagon() |
Modifier and Type | Method and Description |
---|---|
protected int |
backoff(int wait,
String url) |
protected void |
cleanupGetTransfer(Resource resource) |
void |
closeConnection() |
protected org.apache.http.client.methods.CloseableHttpResponse |
execute(org.apache.http.client.methods.HttpUriRequest httpMethod) |
void |
fillInputData(InputData inputData) |
void |
fillOutputData(OutputData outputData) |
protected org.apache.http.client.AuthCache |
getAuthCache() |
BasicAuthScope |
getBasicAuthScope()
Get the override values for standard HttpClient AuthScope
|
protected org.apache.http.client.CredentialsProvider |
getCredentialsProvider() |
static org.apache.http.impl.client.CloseableHttpClient |
getHttpClient() |
HttpConfiguration |
getHttpConfiguration() |
Properties |
getHttpHeaders() |
int |
getInitialBackoffSeconds() |
static int |
getMaxBackoffWaitSeconds() |
BasicAuthScope |
getProxyBasicAuthScope()
Get the override values for proxy HttpClient AuthScope
|
protected String |
getURL(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 |
openConnectionInternal() |
void |
put(File source,
String resourceName)
Copy a file from local system to remote
|
protected void |
putFromStream(InputStream stream,
Resource resource) |
void |
putFromStream(InputStream stream,
String destination) |
void |
putFromStream(InputStream stream,
String destination,
long contentLength,
long lastModified)
Copy from a local input stream to remote.
|
boolean |
resourceExists(String resourceName)
Check if a remote resource exists
|
void |
setBasicAuthScope(BasicAuthScope basicAuth)
Set the override values for standard HttpClient AuthScope
|
void |
setHeaders(org.apache.http.client.methods.HttpUriRequest method) |
void |
setHttpConfiguration(HttpConfiguration httpConfiguration) |
void |
setHttpHeaders(Properties httpHeaders) |
void |
setInitialBackoffSeconds(int initialBackoffSeconds) |
static void |
setPersistentPool(boolean persistent) |
static void |
setPoolingHttpClientConnectionManager(org.apache.http.impl.conn.PoolingHttpClientConnectionManager poolingHttpClientConnectionManager) |
void |
setProxyBasicAuthScope(BasicAuthScope proxyAuth)
Set the override values for proxy HttpClient AuthScope
|
checkInputStream, checkOutputStream, get, getIfNewer, getIfNewerToStream, getInputStream, getOutputStream, getToStream
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addSessionListener, addTransferListener, connect, connect, connect, connect, connect, connect, disconnect, getFileList, getReadTimeout, getRepository, getTimeout, hasSessionListener, hasTransferListener, isInteractive, openConnection, putDirectory, removeSessionListener, removeTransferListener, setInteractive, setReadTimeout, setTimeout, supportsDirectoryCopy
protected static final int SC_TOO_MANY_REQUESTS
public AbstractHttpClientWagon()
protected int backoff(int wait, String url) throws InterruptedException, TransferFailedException
public void openConnectionInternal()
openConnectionInternal
in class AbstractWagon
public void closeConnection()
closeConnection
in class StreamWagon
public static org.apache.http.impl.client.CloseableHttpClient getHttpClient()
public static void setPersistentPool(boolean persistent)
public static void setPoolingHttpClientConnectionManager(org.apache.http.impl.conn.PoolingHttpClientConnectionManager poolingHttpClientConnectionManager)
public void put(File source, String resourceName) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Wagon
put
in interface Wagon
put
in class StreamWagon
source
- the local fileresourceName
- the remote destinationTransferFailedException
ResourceDoesNotExistException
AuthorizationException
public void putFromStream(InputStream stream, String destination, long contentLength, long lastModified) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
StreamingWagon
putFromStream
in interface StreamingWagon
putFromStream
in class StreamWagon
stream
- the local streamdestination
- the remote destinationTransferFailedException
ResourceDoesNotExistException
AuthorizationException
protected void mkdirs(String dirname) throws org.apache.http.HttpException, IOException
org.apache.http.HttpException
IOException
public boolean resourceExists(String resourceName) throws TransferFailedException, AuthorizationException
Wagon
resourceExists
in interface Wagon
resourceExists
in class AbstractWagon
TransferFailedException
- if there's an error trying to access the remote sideAuthorizationException
- if not authorized to verify the existence of the resourceprotected org.apache.http.client.methods.CloseableHttpResponse execute(org.apache.http.client.methods.HttpUriRequest httpMethod) throws org.apache.http.HttpException, IOException
org.apache.http.HttpException
IOException
public void setHeaders(org.apache.http.client.methods.HttpUriRequest method)
protected String getUserAgent(org.apache.http.client.methods.HttpUriRequest method)
protected String getURL(Repository repository)
repository
- public HttpConfiguration getHttpConfiguration()
public void setHttpConfiguration(HttpConfiguration httpConfiguration)
public BasicAuthScope getBasicAuthScope()
public void setBasicAuthScope(BasicAuthScope basicAuth)
basicAuth
- the AuthScope to setpublic BasicAuthScope getProxyBasicAuthScope()
public void setProxyBasicAuthScope(BasicAuthScope proxyAuth)
proxyAuth
- the AuthScope to setpublic void fillInputData(InputData inputData) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
fillInputData
in class StreamWagon
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
protected void cleanupGetTransfer(Resource resource)
cleanupGetTransfer
in class AbstractWagon
public void putFromStream(InputStream stream, String destination) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
putFromStream
in interface StreamingWagon
putFromStream
in class StreamWagon
stream
- the local streamdestination
- the remote destinationTransferFailedException
ResourceDoesNotExistException
AuthorizationException
protected void putFromStream(InputStream stream, Resource resource) throws TransferFailedException, AuthorizationException, ResourceDoesNotExistException
putFromStream
in class StreamWagon
TransferFailedException
AuthorizationException
ResourceDoesNotExistException
public Properties getHttpHeaders()
public void setHttpHeaders(Properties httpHeaders)
public void fillOutputData(OutputData outputData) throws TransferFailedException
fillOutputData
in class StreamWagon
TransferFailedException
protected org.apache.http.client.CredentialsProvider getCredentialsProvider()
protected org.apache.http.client.AuthCache getAuthCache()
public int getInitialBackoffSeconds()
public void setInitialBackoffSeconds(int initialBackoffSeconds)
public static int getMaxBackoffWaitSeconds()
Copyright © 2003–2022 The Apache Software Foundation. All rights reserved.