public class FileDownloader extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
totalNumberOfRetryAttempts |
Constructor and Description |
---|
FileDownloader(File downloadDirectory,
int retries,
int connectTimeout,
int readTimeout) |
Modifier and Type | Method and Description |
---|---|
File |
downloadFile()
Perform the file download
|
boolean |
fileExistsAndIsValid(File fileToCheck)
Check if the file exists and perform a getHash check on it to see if it is valid
|
void |
remoteURL(URL value)
Set the URL that will be used to download the remote file.
|
void |
setHash(String hashValue,
HashType hashType)
Set the getHash and getHash type that will be used to check that the file is valid
|
public FileDownloader(File downloadDirectory, int retries, int connectTimeout, int readTimeout) throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureException
public boolean fileExistsAndIsValid(File fileToCheck) throws IOException, org.apache.maven.plugin.MojoExecutionException
fileToCheck
- the file to perform a hash validation againstIOException
org.apache.maven.plugin.MojoExecutionException
public void remoteURL(URL value) throws org.apache.maven.plugin.MojoExecutionException
value
- The URL used to download the file.org.apache.maven.plugin.MojoExecutionException
public void setHash(String hashValue, HashType hashType)
hashValue
- The file hashhashType
- What type of hash this ispublic File downloadFile() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
Copyright © 2014. All Rights Reserved.