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:
WebDavWagon

public abstract class AbstractHttpClientWagon
extends StreamWagon

Author:
Michal Maczka, James William Dumay

Field Summary
protected  org.apache.commons.httpclient.HttpConnectionManager connectionManager
           
protected static TimeZone GMT_TIME_ZONE
           
protected static int SC_NULL
           
 
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
DEFAULT_CONNECTION_TIMEOUT, DEFAULT_READ_TIMEOUT, ROLE
 
Constructor Summary
AbstractHttpClientWagon()
           
 
Method Summary
protected  void cleanupGetTransfer(Resource resource)
           
 void closeConnection()
           
protected  int execute(org.apache.commons.httpclient.HttpMethod httpMethod)
           
 void fillInputData(InputData inputData)
           
 void fillOutputData(OutputData outputData)
           
protected  org.apache.commons.httpclient.HttpClient getClient()
           
 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  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 setConnectionManager(org.apache.commons.httpclient.HttpConnectionManager connectionManager)
           
protected  void setHeaders(org.apache.commons.httpclient.HttpMethod method)
           
 void setHttpConfiguration(HttpConfiguration httpConfiguration)
           
 void setHttpHeaders(Properties httpHeaders)
           
protected  void setParameters(org.apache.commons.httpclient.HttpMethod method)
           
 
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, getFileList, getPath, getPermissionsOverride, getProxyInfo, getProxyInfo, getReadTimeout, getRepository, getSessionEventSupport, getTimeout, 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
 
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_NULL

protected static final int SC_NULL
See Also:
Constant Field Values

GMT_TIME_ZONE

protected static final TimeZone GMT_TIME_ZONE

connectionManager

protected org.apache.commons.httpclient.HttpConnectionManager connectionManager
Constructor Detail

AbstractHttpClientWagon

public AbstractHttpClientWagon()
Method Detail

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 IOException
Throws:
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 int execute(org.apache.commons.httpclient.HttpMethod httpMethod)
               throws IOException
Throws:
IOException

setParameters

protected void setParameters(org.apache.commons.httpclient.HttpMethod method)

setHeaders

protected void setHeaders(org.apache.commons.httpclient.HttpMethod 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:

getClient

protected org.apache.commons.httpclient.HttpClient getClient()

setConnectionManager

public void setConnectionManager(org.apache.commons.httpclient.HttpConnectionManager connectionManager)

getHttpHeaders

public Properties getHttpHeaders()

setHttpHeaders

public void setHttpHeaders(Properties httpHeaders)

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

putFromStream

public void putFromStream(InputStream stream,
                          String destination)
                   throws TransferFailedException,
                          ResourceDoesNotExistException,
                          AuthorizationException
Specified by:
putFromStream in interface StreamingWagon
Overrides:
putFromStream in class StreamWagon
Parameters:
stream - the local stream
destination - the remote destination
Throws:
TransferFailedException
ResourceDoesNotExistException
AuthorizationException

putFromStream

protected void putFromStream(InputStream stream,
                             Resource resource)
                      throws TransferFailedException,
                             AuthorizationException,
                             ResourceDoesNotExistException
Overrides:
putFromStream in class StreamWagon
Throws:
TransferFailedException
AuthorizationException
ResourceDoesNotExistException

fillOutputData

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


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