Rio Project 4.2 API Documentation



org.rioproject.resources.util
Class DownloadManager

java.lang.Object
  extended by org.rioproject.resources.util.DownloadManager

public class DownloadManager
extends Object

The DownloadManager class provides support to manage the download and installation of artifacts

Author:
Dennis Reedy

Nested Class Summary
static class DownloadManager.ExtractResults
           
 
Constructor Summary
DownloadManager(StagedData stagedData)
          Create an instance of the DownloadManager
DownloadManager(String installPath, StagedData stagedData)
          Create an instance of the DownloadManager
 
Method Summary
 DownloadRecord download()
          Performs software download for a Download
static DownloadManager.ExtractResults extract(File directory, File archive)
          Extract an archive
static void main(String[] args)
           
 DownloadRecord postInstall()
          Perform post-install task(s) as described by the StagedSoftware object
 void remove()
          Remove installed software
static String remove(DownloadRecord record)
          Remove installed software
 void setShowDownloadTo(boolean show)
          Whether to emit logger statements documenting where the data is being downloaded to
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DownloadManager

public DownloadManager(StagedData stagedData)
Create an instance of the DownloadManager

Parameters:
stagedData - The Download

DownloadManager

public DownloadManager(String installPath,
                       StagedData stagedData)
Create an instance of the DownloadManager

Parameters:
installPath - The root directory to download the software. If the directory does not exist, it will be created. Read and write access permissions are required to the directory
stagedData - The Download
Method Detail

download

public DownloadRecord download()
                        throws IOException
Performs software download for a Download

Returns:
The DownloadRecord based on attributes from the downloaded software
Throws:
IOException - if there are errors accessing the file system

setShowDownloadTo

public void setShowDownloadTo(boolean show)
Whether to emit logger statements documenting where the data is being downloaded to

Parameters:
show - If true emit (default)

extract

public static DownloadManager.ExtractResults extract(File directory,
                                                     File archive)
                                              throws IOException
Extract an archive

Parameters:
directory - the directory to extract to
archive - The archive to extract
Returns:
An ExtractResults class detailing what was extracted
Throws:
IOException - if there are errors extracting the archive

postInstall

public DownloadRecord postInstall()
                           throws IOException
Perform post-install task(s) as described by the StagedSoftware object

Returns:
A DownloadRecord for the post install if software was downloaded to perform the post install task(s). If no software was downloaded to perform the task(s), return null
Throws:
IOException - if there are errors accessing the file system

remove

public void remove()
Remove installed software


remove

public static String remove(DownloadRecord record)
Remove installed software

Parameters:
record - The DownloadRecord to remove
Returns:
the top-most directory/file that was removed

main

public static void main(String[] args)

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.