com.lazerycode.selenium.download
Class FileDownloader

java.lang.Object
  extended by com.lazerycode.selenium.download.FileDownloader

public class FileDownloader
extends Object


Constructor Summary
FileDownloader(File downloadDirectory, int retries, int connectTimeout, int readTimeout)
           
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileDownloader

public FileDownloader(File downloadDirectory,
                      int retries,
                      int connectTimeout,
                      int readTimeout)
               throws org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoFailureException
Method Detail

fileExistsAndIsValid

public boolean fileExistsAndIsValid(File fileToCheck)
                             throws IOException,
                                    org.apache.maven.plugin.MojoExecutionException
Check if the file exists and perform a getHash check on it to see if it is valid

Parameters:
fileToCheck -
Returns:
Throws:
IOException
org.apache.maven.plugin.MojoExecutionException

remoteURL

public void remoteURL(URL value)
               throws org.apache.maven.plugin.MojoExecutionException
Set the URL that will be used to download the remote file.

Parameters:
value -
Throws:
org.apache.maven.plugin.MojoExecutionException

setHash

public void setHash(String hashValue,
                    HashType hashType)
Set the getHash and getHash type that will be used to check that the file is valid

Parameters:
hashValue -
hashType -

downloadFile

public File downloadFile()
                  throws org.apache.maven.plugin.MojoExecutionException
Perform the file download

Returns:
File
Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2012. All Rights Reserved.