Package org.apache.maven.wagon
Interface Wagon
- All Known Subinterfaces:
CommandExecutor,StreamingWagon
- All Known Implementing Classes:
AbstractHttpClientWagon,AbstractWagon,FileWagon,HttpWagon,StreamWagon
public interface Wagon
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intdefault 60s approximately 1 minutestatic final intdefault 1800s approximately 30 minutesstatic final String -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSessionListener(SessionListener listener) voidaddTransferListener(TransferListener listener) voidconnect(Repository source) Initiate the connection to the repository.voidconnect(Repository source, AuthenticationInfo authenticationInfo) Initiate the connection to the repository.voidconnect(Repository source, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo) Initiate the connection to the repository.voidconnect(Repository source, AuthenticationInfo authenticationInfo, ProxyInfoProvider proxyInfoProvider) Initiate the connection to the repository.voidconnect(Repository source, ProxyInfo proxyInfo) Initiate the connection to the repository.voidconnect(Repository source, ProxyInfoProvider proxyInfoProvider) Initiate the connection to the repository.voidDisconnect from the repository.voidDownloads specified resource from the repository to given file.getFileList(String destinationDirectory) Returns aListof strings naming the files and directories in the directory denoted by this abstract pathname.booleangetIfNewer(String resourceName, File destination, long timestamp) Downloads specified resource from the repository if it was modified since specified date.intGet the read timeout limit in millisecondsintGet the connection timeout limit in millisecondsbooleanhasSessionListener(SessionListener listener) booleanhasTransferListener(TransferListener listener) booleanvoidDeprecated.voidCopy a file from local system to remotevoidputDirectory(File sourceDirectory, String destinationDirectory) Copy a directory from local system to remotevoidremoveSessionListener(SessionListener listener) voidremoveTransferListener(TransferListener listener) booleanresourceExists(String resourceName) Check if a remote resource existsvoidsetInteractive(boolean interactive) voidsetReadTimeout(int timeoutValue) Set the read timeout limit in millisecondsvoidsetTimeout(int timeoutValue) Set the connection timeout limit in millisecondsbooleanFlag 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:
TransferFailedExceptionResourceDoesNotExistExceptionAuthorizationException
-
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:
trueif newer resource has been downloaded,falseif resource in the repository is older or has the same age.- Throws:
TransferFailedExceptionResourceDoesNotExistExceptionAuthorizationException
-
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:
TransferFailedExceptionResourceDoesNotExistExceptionAuthorizationException
-
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:
TransferFailedExceptionResourceDoesNotExistExceptionAuthorizationException
-
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 aListof 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 aListof 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
Listof strings naming the files and directories in the directory denoted by this abstract pathname. TheListwill 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