Package org.apache.maven.wagon
Interface Wagon
- All Known Subinterfaces:
CommandExecutor
,StreamingWagon
- All Known Implementing Classes:
AbstractWagon
,StreamWagon
public interface Wagon
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
default 60s approximately 1 minutestatic final int
default 1800s approximately 30 minutesstatic final String
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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 from the repository.void
Downloads specified resource from the repository to given file.getFileList
(String destinationDirectory) Returns aList
of strings naming the files and directories in the directory denoted by this abstract pathname.boolean
getIfNewer
(String resourceName, File destination, long timestamp) Downloads specified resource from the repository if it was modified since specified date.int
Get the read timeout limit in millisecondsint
Get the connection timeout limit in millisecondsboolean
hasSessionListener
(SessionListener listener) boolean
hasTransferListener
(TransferListener listener) boolean
void
Deprecated.void
Copy a file from local system to remotevoid
putDirectory
(File sourceDirectory, String destinationDirectory) Copy a directory from local system to remotevoid
removeSessionListener
(SessionListener listener) void
removeTransferListener
(TransferListener listener) boolean
resourceExists
(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
Flag indicating if this wagon supports directory copy operations.
-
Field Details
-
ROLE
-
DEFAULT_CONNECTION_TIMEOUT
static final int DEFAULT_CONNECTION_TIMEOUTdefault 60s approximately 1 minute- See Also:
-
DEFAULT_READ_TIMEOUT
static final int DEFAULT_READ_TIMEOUTdefault 1800s approximately 30 minutes- Since:
- 2.2
- See Also:
-
-
Method Details
-
get
void get(String resourceName, 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(String resourceName, 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(File source, 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(File sourceDirectory, 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
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
List<String> getFileList(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
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
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
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
-
removeSessionListener
-
hasSessionListener
-
addTransferListener
-
removeTransferListener
-
hasTransferListener
-
isInteractive
boolean isInteractive() -
setInteractive
void setInteractive(boolean interactive)
-
connect(org.apache.maven.wagon.repository.Repository)
or related methods - this is an internal method