if (inputContext != null) {
for (Iterator<String> iterator = inputContext.getNames(); iterator.hasNext();) {
String key = iterator.next();
if (inputContext.getValue(key).hasType(DataType.FILE)) {
FileParameterType fileParameter = (FileParameterType) inputContext.getValue(key).getType();
/*
* Determine scheme
*/
URI uri = URI.create(fileParameter.getValue());
if (uri.getScheme().equalsIgnoreCase(GridFtp.GSIFTP_SCHEME)) {
/*
* Desctination complete URI
*/
File file = new File(uri.getPath());
String destFilePath = file.getName();
ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp().getType();
destFilePath = app.getInputDataDirectory() + File.separator + destFilePath;
HostDescriptionType hostDescription = context.getExecutionDescription().getHost().getType();
if (hostDescription instanceof GlobusHostType) {
gridFTPTransfer(context, uri, destFilePath);
} else if (GfacUtils.isLocalHost(hostDescription.getHostAddress())) {
downloadFile(context, uri, destFilePath);
}
/*
* Replace parameter
*/
fileParameter.setValue(destFilePath);
}
}
}
} else {
log.debug("Input Context is null");