if (hostgridFTP == null || hostgridFTP.length == 0) {
hostgridFTP = new String[] { host.getHostAddress() };
}
boolean success = false;
ProviderException pe = null;// = new ProviderException("");
for (String endpoint : host.getGridFTPEndPointArray()) {
try {
URI tmpdirURI = GfacUtils.createGsiftpURI(endpoint, app.getScratchWorkingDirectory());
URI workingDirURI = GfacUtils.createGsiftpURI(endpoint, app.getStaticWorkingDirectory());
URI inputURI = GfacUtils.createGsiftpURI(endpoint, app.getInputDataDirectory());
URI outputURI = GfacUtils.createGsiftpURI(endpoint, app.getOutputDataDirectory());
log.debug("Host FTP = " + hostgridFTP);
log.debug("temp directory = " + tmpdirURI);
log.debug("Working directory = " + workingDirURI);
log.debug("Input directory = " + inputURI);
log.debug("Output directory = " + outputURI);
ftp.makeDir(tmpdirURI, gssCred);
ftp.makeDir(workingDirURI, gssCred);
ftp.makeDir(inputURI, gssCred);
ftp.makeDir(outputURI, gssCred);
success = true;
break;
} catch (URISyntaxException e) {
pe = new ProviderException("URI is malformatted:" + e.getMessage(), e,invocationContext);
} catch (ToolsException e) {
pe = new ProviderException(e.getMessage(), e,invocationContext);
}
}
if (success == false) {
throw pe;
}
} catch (SecurityException e) {
throw new ProviderException(e.getMessage(), e,invocationContext);
}
}