public class Downloader extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Downloader.PackageType |
static class |
Downloader.UnreachablePackageException
Unreachable package exception
|
| Modifier and Type | Field and Description |
|---|---|
File |
downloadedFile
File name of the package downloaded from the Repository service
|
protected org.gcube.common.core.utils.logging.GCUBELog |
logger
local logger
|
protected String |
packagedir
The folder where the package tarball is uncompressed
|
String |
packagename
Name of the package to download
|
protected Downloader.PackageType |
packagetype |
protected String |
packageVersion
Version of the package to download
|
protected static String |
REPOSITORY_CLASS
Target service class.
|
protected static String |
REPOSITORY_ENDPOINT
Target port-type name.
|
protected static String |
REPOSITORY_NAME
Target service name.
|
protected AntRunner |
run
Local Ant runner
|
protected String |
serviceClass
Service class of the package's service
|
protected String |
serviceID
Service ID of the package's service
|
protected String |
serviceKey
Service key of the package's service
|
protected String |
serviceName
Service name of the package's service
|
protected String |
serviceVersion
Service version of the package's service
|
protected boolean |
update |
| Constructor and Description |
|---|
Downloader(org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo deployable_package,
boolean... update) |
| Modifier and Type | Method and Description |
|---|---|
String |
downloadPackage(File file)
Downloads the package from a local path
|
String |
downloadPackage(org.gcube.common.core.scope.GCUBEScope... scope)
Downloads the package tarball.
|
String |
downloadPackage(URI uri)
Downloads the package
|
String |
downloadPatch(URI uri)
Downloads the patch
|
protected Set<org.apache.axis.message.addressing.EndpointReferenceType> |
findInstances(org.gcube.common.core.scope.GCUBEScope scopeToCheckIn)
Finds instances of the Software Repository service in the current scope(s)
|
String |
getPackagedir() |
String |
getPackageFilesDir() |
String |
getPackagename() |
Downloader.PackageType |
getPackagetype() |
String |
getServiceKey() |
protected String |
internalHTTPdownload(String baseDir,
URI uri) |
boolean |
isUpdate() |
protected void |
removeFiles()
Removes the package files
|
protected AntRunner run
protected final org.gcube.common.core.utils.logging.GCUBELog logger
public String packagename
protected String packageVersion
public File downloadedFile
protected String serviceID
protected String serviceName
protected String serviceKey
protected static final String REPOSITORY_ENDPOINT
protected static final String REPOSITORY_NAME
protected static final String REPOSITORY_CLASS
protected String serviceClass
protected String serviceVersion
protected String packagedir
protected boolean update
protected Downloader.PackageType packagetype
public Downloader(org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo deployable_package,
boolean... update)
throws DeployException,
Exception
serviceID - the service ID of the packagepackageName - the name of the packageupdate - it states if the package is going to be updated or notDeployExceptionExceptionpublic String downloadPackage(org.gcube.common.core.scope.GCUBEScope... scope) throws Downloader.UnreachablePackageException, Exception
scope - the scope where to look for the packageVOException - if an error occurs in the download operationDownloader.UnreachablePackageExceptionExceptionpublic String downloadPackage(File file) throws DeployException, IOException, InvalidPackageArchiveException
file - the tarball on the local file systemInvalidPackageArchiveExceptionIOExceptionDeployExceptionpublic String downloadPatch(URI uri) throws Downloader.UnreachablePackageException, DeployException, InvalidPackageArchiveException
uri - the uri from which the patch has to be downloadedDownloader.UnreachablePackageException - it the download failsInvalidPackageArchiveExceptionDeployExceptionpublic String downloadPackage(URI uri) throws Downloader.UnreachablePackageException, DeployException, InvalidPackageArchiveException
uri - the uri from which the package has to be downloadedDownloader.UnreachablePackageException - it the download failsInvalidPackageArchiveExceptionDeployExceptionprotected String internalHTTPdownload(String baseDir, URI uri) throws Downloader.UnreachablePackageException, DeployException, InvalidPackageArchiveException
protected void removeFiles()
throws DeployException
DeployException - if the delete operation failsprotected Set<org.apache.axis.message.addressing.EndpointReferenceType> findInstances(org.gcube.common.core.scope.GCUBEScope scopeToCheckIn)
Exceptionpublic String getPackagename()
public String getPackagedir()
public String getPackageFilesDir()
public String getServiceKey()
public Downloader.PackageType getPackagetype()
public boolean isUpdate()
Copyright © 2015. All Rights Reserved.