Package org.apache.maven.wagon
Interface Wagon
-
- All Known Subinterfaces:
CommandExecutor
,StreamingWagon
- All Known Implementing Classes:
AbstractHttpClientWagon
,AbstractWagon
,FileWagon
,FtpHttpWagon
,FtpsWagon
,FtpWagon
,HttpWagon
,LightweightHttpsWagon
,LightweightHttpWagon
,StreamWagon
public interface Wagon
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_CONNECTION_TIMEOUT
default 60s approximately 1 minutestatic int
DEFAULT_READ_TIMEOUT
default 1800s approximately 30 minutesstatic java.lang.String
ROLE
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addSessionListener(SessionListener listener)
void
addTransferListener(TransferListener listener)
void
connect(Repository source)
Initiate the connection to the repository.void
connect(Repository source, AuthenticationInfo authenticationInfo)
Initiate the connection to the repository.void
connect(Repository source, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo)
Initiate the connection to the repository.void
connect(Repository source, AuthenticationInfo authenticationInfo, ProxyInfoProvider proxyInfoProvider)
Initiate the connection to the repository.void
connect(Repository source, ProxyInfo proxyInfo)
Initiate the connection to the repository.void
connect(Repository source, ProxyInfoProvider proxyInfoProvider)
Initiate the connection to the repository.void
disconnect()
Disconnect from the repository.void
get(java.lang.String resourceName, java.io.File destination)
Downloads specified resource from the repository to given file.java.util.List<java.lang.String>
getFileList(java.lang.String destinationDirectory)
Returns aList
of strings naming the files and directories in the directory denoted by this abstract pathname.boolean
getIfNewer(java.lang.String resourceName, java.io.File destination, long timestamp)
Downloads specified resource from the repository if it was modified since specified date.int
getReadTimeout()
Get the read timeout limit in millisecondsRepository
getRepository()
int
getTimeout()
Get the connection timeout limit in millisecondsboolean
hasSessionListener(SessionListener listener)
boolean
hasTransferListener(TransferListener listener)
boolean
isInteractive()
void
openConnection()
Deprecated.connect using theconnect(org.apache.maven.wagon.repository.Repository)
or related methods - this is an internal methodvoid
put(java.io.File source, java.lang.String destination)
Copy a file from local system to remotevoid
putDirectory(java.io.File sourceDirectory, java.lang.String destinationDirectory)
Copy a directory from local system to remotevoid
removeSessionListener(SessionListener listener)
void
removeTransferListener(TransferListener listener)
boolean
resourceExists(java.lang.String resourceName)
Check if a remote resource existsvoid
setInteractive(boolean interactive)
void
setReadTimeout(int timeoutValue)
Set the read timeout limit in millisecondsvoid
setTimeout(int timeoutValue)
Set the connection timeout limit in millisecondsboolean
supportsDirectoryCopy()
Flag indicating if this wagon supports directory copy operations.
-
-
-
Field Detail
-
ROLE
static final java.lang.String ROLE
-
DEFAULT_CONNECTION_TIMEOUT
static final int DEFAULT_CONNECTION_TIMEOUT
default 60s approximately 1 minute- See Also:
- Constant Field Values
-
DEFAULT_READ_TIMEOUT
static final int DEFAULT_READ_TIMEOUT
default 1800s approximately 30 minutes- Since:
- 2.2
- See Also:
- Constant Field Values
-
-
Method Detail
-
get
void get(java.lang.String resourceName, java.io.File destination) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Downloads specified resource from the repository to given file.- Parameters:
resourceName
-destination
-- Throws:
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
-
getIfNewer
boolean getIfNewer(java.lang.String resourceName, java.io.File destination, long timestamp) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Downloads specified resource from the repository if it was modified since specified date. The date is measured in milliseconds, between the current time and midnight, January 1, 1970 UTC and aligned to GMT timezone.- Parameters:
resourceName
-destination
-timestamp
-- Returns:
true
if newer resource has been downloaded,false
if resource in the repository is older or has the same age.- Throws:
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
-
put
void put(java.io.File source, java.lang.String destination) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Copy a file from local system to remote- Parameters:
source
- the local filedestination
- the remote destination- Throws:
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
-
putDirectory
void putDirectory(java.io.File sourceDirectory, java.lang.String destinationDirectory) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Copy a directory from local system to remote- Parameters:
sourceDirectory
- the local directorydestinationDirectory
- the remote destination- Throws:
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
-
resourceExists
boolean resourceExists(java.lang.String resourceName) throws TransferFailedException, AuthorizationException
Check if a remote resource exists- Parameters:
resourceName
-- Returns:
- whether the resource exists or not
- Throws:
TransferFailedException
- if there's an error trying to access the remote sideAuthorizationException
- if not authorized to verify the existence of the resource
-
getFileList
java.util.List<java.lang.String> getFileList(java.lang.String destinationDirectory) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Returns aList
of strings naming the files and directories in the directory denoted by this abstract pathname. If this abstract pathname does not denote a directory, or does not exist, then this method throwsResourceDoesNotExistException
. Otherwise aList
of strings is returned, one for each file or directory in the directory. Names denoting the directory itself and the directory's parent directory are not included in the result. Each string is a file name rather than a complete path. There is no guarantee that the name strings in the resulting list will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order.- Parameters:
destinationDirectory
- directory to list contents of- Returns:
- A
List
of strings naming the files and directories in the directory denoted by this abstract pathname. TheList
will be empty if the directory is empty. - Throws:
TransferFailedException
- if there's an error trying to access the remote sideResourceDoesNotExistException
- if destinationDirectory does not exist or is not a directoryAuthorizationException
- if not authorized to list the contents of the directory
-
supportsDirectoryCopy
boolean supportsDirectoryCopy()
Flag indicating if this wagon supports directory copy operations.- Returns:
- whether if this wagon supports directory operations
-
getRepository
Repository getRepository()
-
connect
void connect(Repository source) throws ConnectionException, AuthenticationException
Initiate the connection to the repository.- Parameters:
source
- the repository to connect to- Throws:
ConnectionException
- if there is a problem connectingAuthenticationException
- if the credentials for connecting are not sufficient
-
connect
void connect(Repository source, ProxyInfo proxyInfo) throws ConnectionException, AuthenticationException
Initiate the connection to the repository.- Parameters:
source
- the repository to connect to- Throws:
ConnectionException
- if there is a problem connectingAuthenticationException
- if the credentials for connecting are not sufficient
-
connect
void connect(Repository source, ProxyInfoProvider proxyInfoProvider) throws ConnectionException, AuthenticationException
Initiate the connection to the repository.- Parameters:
source
- the repository to connect toproxyInfoProvider
- the provider to obtain a network proxy to use to connect to the remote repository- Throws:
ConnectionException
- if there is a problem connectingAuthenticationException
- if the credentials for connecting are not sufficient
-
connect
void connect(Repository source, AuthenticationInfo authenticationInfo) throws ConnectionException, AuthenticationException
Initiate the connection to the repository.- Parameters:
source
- the repository to connect toauthenticationInfo
- authentication credentials for connecting- Throws:
ConnectionException
- if there is a problem connectingAuthenticationException
- if the credentials for connecting are not sufficient
-
connect
void connect(Repository source, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo) throws ConnectionException, AuthenticationException
Initiate the connection to the repository.- Parameters:
source
- the repository to connect toauthenticationInfo
- authentication credentials for connectingproxyInfo
- the network proxy to use to connect to the remote repository- Throws:
ConnectionException
- if there is a problem connectingAuthenticationException
- if the credentials for connecting are not sufficient
-
connect
void connect(Repository source, AuthenticationInfo authenticationInfo, ProxyInfoProvider proxyInfoProvider) throws ConnectionException, AuthenticationException
Initiate the connection to the repository.- Parameters:
source
- the repository to connect toauthenticationInfo
- authentication credentials for connectingproxyInfoProvider
- the provider to obtain a network proxy to use to connect to the remote repository- Throws:
ConnectionException
- if there is a problem connectingAuthenticationException
- if the credentials for connecting are not sufficient
-
openConnection
void openConnection() throws ConnectionException, AuthenticationException
Deprecated.connect using theconnect(org.apache.maven.wagon.repository.Repository)
or related methods - this is an internal methodInitiate the connection to the repository.- Throws:
ConnectionException
- if there is a problem connectingAuthenticationException
- if ther credentials for connecting are not sufficient
-
disconnect
void disconnect() throws ConnectionException
Disconnect from the repository.- Throws:
ConnectionException
- if there is a problem disconnecting
-
setTimeout
void setTimeout(int timeoutValue)
Set the connection timeout limit in milliseconds
-
getTimeout
int getTimeout()
Get the connection timeout limit in milliseconds
-
setReadTimeout
void setReadTimeout(int timeoutValue)
Set the read timeout limit in milliseconds- Since:
- 2.2
-
getReadTimeout
int getReadTimeout()
Get the read timeout limit in milliseconds- Since:
- 2.2
-
addSessionListener
void addSessionListener(SessionListener listener)
-
removeSessionListener
void removeSessionListener(SessionListener listener)
-
hasSessionListener
boolean hasSessionListener(SessionListener listener)
-
addTransferListener
void addTransferListener(TransferListener listener)
-
removeTransferListener
void removeTransferListener(TransferListener listener)
-
hasTransferListener
boolean hasTransferListener(TransferListener listener)
-
isInteractive
boolean isInteractive()
-
setInteractive
void setInteractive(boolean interactive)
-
-