org.apache.maven.wagon.shared.http
Class AbstractHttpClientWagon

java.lang.Object
  extended by org.apache.maven.wagon.AbstractWagon
      extended by org.apache.maven.wagon.StreamWagon
          extended by org.apache.maven.wagon.shared.http.AbstractHttpClientWagon
All Implemented Interfaces:
StreamingWagon, Wagon
Direct Known Subclasses:
HttpWagon, WebDavWagon

public abstract class AbstractHttpClientWagon
extends StreamWagon

Author:
Michal Maczka, James William Dumay

Field Summary
protected  org.apache.http.conn.ClientConnectionManager clientConnectionManager
           
protected static org.apache.http.conn.ClientConnectionManager connectionManagerPooled
           
protected static TimeZone GMT_TIME_ZONE
           
protected static boolean IGNORE_SSL_VALIDITY_DATES
          if using sslEasy certificate date issues will be ignored enabled by default
protected static int SC_NULL
           
protected static boolean sslAllowAll
          ssl hostname verifier is allow all by default.
protected static boolean sslEasy
          skip failure on certificate validity checks.
protected static boolean useClientManagerPooled
          use http(s) connection pool mechanism.
 
Fields inherited from class org.apache.maven.wagon.AbstractWagon
authenticationInfo, DEFAULT_BUFFER_SIZE, interactive, proxyInfo, repository, sessionEventSupport, transferEventSupport
 
Fields inherited from interface org.apache.maven.wagon.Wagon
ROLE
 
Constructor Summary
AbstractHttpClientWagon()
           
 
Method Summary
protected  void cleanupGetTransfer(Resource resource)
           
 void closeConnection()
           
protected  org.apache.http.HttpResponse execute(org.apache.http.client.methods.HttpUriRequest httpMethod)
           
 void fillInputData(InputData inputData)
           
 void fillOutputData(OutputData outputData)
           
 org.apache.http.conn.ClientConnectionManager getConnectionManager()
           
 HttpConfiguration getHttpConfiguration()
           
 Properties getHttpHeaders()
           
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
 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
static void setConnectionManagerPooled(org.apache.http.conn.ClientConnectionManager clientConnectionManager)
           
protected  void setHeaders(org.apache.http.client.methods.HttpUriRequest method)
           
 void setHttpConfiguration(HttpConfiguration httpConfiguration)
           
 void setHttpHeaders(Properties httpHeaders)
           
protected  void setParameters(org.apache.http.client.methods.HttpUriRequest method)
           
static void setUseClientManagerPooled(boolean pooledClientManager)
           
 
Methods inherited from class org.apache.maven.wagon.StreamWagon
checkInputStream, checkOutputStream, get, getIfNewer, getIfNewerToStream, getInputStream, getOutputStream, getToStream, putFromStream
 
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, getFileList, getPath, getPermissionsOverride, getProxyInfo, getProxyInfo, getRepository, getSessionEventSupport, getTimeout, getTransfer, getTransfer, getTransfer, getTransfer, getTransferEventSupport, hasSessionListener, hasTransferListener, isInteractive, openConnection, postProcessListeners, putDirectory, putTransfer, putTransfer, removeSessionListener, removeTransferListener, setInteractive, setPermissionsOverride, setSessionEventSupport, setTimeout, setTransferEventSupport, supportsDirectoryCopy, 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, getRepository, getTimeout, hasSessionListener, hasTransferListener, isInteractive, openConnection, putDirectory, removeSessionListener, removeTransferListener, setInteractive, setTimeout, supportsDirectoryCopy
 

Field Detail

SC_NULL

protected static final int SC_NULL
See Also:
Constant Field Values

GMT_TIME_ZONE

protected static final TimeZone GMT_TIME_ZONE

connectionManagerPooled

protected static org.apache.http.conn.ClientConnectionManager connectionManagerPooled
Since:
2.0

clientConnectionManager

protected org.apache.http.conn.ClientConnectionManager clientConnectionManager
Since:
2.0

useClientManagerPooled

protected static boolean useClientManagerPooled
use http(s) connection pool mechanism. enabled by default

Since:
2.0

sslEasy

protected static boolean sslEasy
skip failure on certificate validity checks. enabled by default

Since:
2.0

sslAllowAll

protected static boolean sslAllowAll
ssl hostname verifier is allow all by default. Disable this will use a browser compat hostname verifier enabled by default

Since:
2.0

IGNORE_SSL_VALIDITY_DATES

protected static boolean IGNORE_SSL_VALIDITY_DATES
if using sslEasy certificate date issues will be ignored enabled by default

Since:
2.0
Constructor Detail

AbstractHttpClientWagon

public AbstractHttpClientWagon()
Method Detail

getConnectionManager

public org.apache.http.conn.ClientConnectionManager getConnectionManager()

setConnectionManagerPooled

public static void setConnectionManagerPooled(org.apache.http.conn.ClientConnectionManager clientConnectionManager)

setUseClientManagerPooled

public static void setUseClientManagerPooled(boolean pooledClientManager)

openConnectionInternal

public void openConnectionInternal()
Specified by:
openConnectionInternal in class AbstractWagon

closeConnection

public void closeConnection()
Specified by:
closeConnection in class StreamWagon

put

public void put(File source,
                String resourceName)
         throws TransferFailedException,
                ResourceDoesNotExistException,
                AuthorizationException
Description copied from interface: Wagon
Copy a file from local system to remote

Specified by:
put in interface Wagon
Overrides:
put in class StreamWagon
Parameters:
source - the local file
resourceName - the remote destination
Throws:
TransferFailedException
ResourceDoesNotExistException
AuthorizationException

putFromStream

public void putFromStream(InputStream stream,
                          String destination,
                          long contentLength,
                          long lastModified)
                   throws TransferFailedException,
                          ResourceDoesNotExistException,
                          AuthorizationException
Description copied from interface: StreamingWagon
Copy from a local input stream to remote.

Specified by:
putFromStream in interface StreamingWagon
Overrides:
putFromStream in class StreamWagon
Parameters:
stream - the local stream
destination - the remote destination
Throws:
TransferFailedException
ResourceDoesNotExistException
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 TransferFailedException,
                              AuthorizationException
Description copied from interface: Wagon
Check if a remote resource exists

Specified by:
resourceExists in interface Wagon
Overrides:
resourceExists in class AbstractWagon
Returns:
whether the resource exists or not
Throws:
TransferFailedException - if there's an error trying to access the remote side
AuthorizationException - if not authorized to verify the existence of the resource

execute

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

setParameters

protected void setParameters(org.apache.http.client.methods.HttpUriRequest method)

setHeaders

protected void setHeaders(org.apache.http.client.methods.HttpUriRequest method)

getUserAgent

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

getURL

protected String getURL(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)

fillInputData

public void fillInputData(InputData inputData)
                   throws TransferFailedException,
                          ResourceDoesNotExistException,
                          AuthorizationException
Specified by:
fillInputData in class StreamWagon
Throws:
TransferFailedException
ResourceDoesNotExistException
AuthorizationException

cleanupGetTransfer

protected void cleanupGetTransfer(Resource resource)
Overrides:
cleanupGetTransfer in class AbstractWagon

fillOutputData

public void fillOutputData(OutputData outputData)
                    throws TransferFailedException
Specified by:
fillOutputData in class StreamWagon
Throws:
TransferFailedException

getHttpHeaders

public Properties getHttpHeaders()

setHttpHeaders

public void setHttpHeaders(Properties httpHeaders)


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.