org.jppf.libmanagement
Class Downloader

java.lang.Object
  extended by org.jppf.libmanagement.Downloader

public class Downloader
extends Object

Author:
Laurent Cohen

Constructor Summary
Downloader()
          Default constructor.
 
Method Summary
 boolean checkFilesPresent(File folder, String... names)
          Check that the specified files are present in the specified path.
 void extractFiles(String sourceUrl, String destPath, String... names)
          Extract the specified files from the specified archive.
 LocationEventListener getListener()
          Get the location listener used to show the progress of the download.
static void main(String... args)
          Entry point.
 void setListener(LocationEventListener listener)
          Set the location listener used to show the progress of the download.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Downloader

public Downloader()
Default constructor.

Method Detail

main

public static void main(String... args)
Entry point.

Parameters:
args - - not used.

extractFiles

public void extractFiles(String sourceUrl,
                         String destPath,
                         String... names)
                  throws Exception
Extract the specified files from the specified archive.

Parameters:
sourceUrl - - the URL pointing to the archive to download.
destPath - - the oflder in which to extract the files.
names - - the names of the zip entries to extract.
Throws:
Exception - if any IO error occurs.

checkFilesPresent

public boolean checkFilesPresent(File folder,
                                 String... names)
Check that the specified files are present in the specified path.

Parameters:
folder - - the folder in which to check for the files.
names - - the names of the files to lookup.
Returns:
true if the folder and the files exist.

getListener

public LocationEventListener getListener()
Get the location listener used to show the progress of the download.

Returns:
a LocationEventListener instance.

setListener

public void setListener(LocationEventListener listener)
Set the location listener used to show the progress of the download.

Parameters:
listener - - a LocationEventListener instance.


Copyright © 2005-2010 JPPF Team.