detail.setTransferDescription("Output: " + stringMap.get(paramName).toString());
registry.add(ChildDataType.DATA_TRANSFER_DETAIL,detail, jobExecutionContext.getTaskData().getTaskID());
}
if (outputArray == null || outputArray.isEmpty()) {
throw new GFacHandlerException("Empty Output returned from the Application, Double check the application" +
"and ApplicationDescriptor output Parameter Names");
}
// If users has given an output Data path to download the output files this will download the file on machine where GFac is installed
TaskDetails taskData = jobExecutionContext.getTaskData();
if(taskData != null && taskData.getAdvancedOutputDataHandling() != null){
String outputDataDirectory = taskData.getAdvancedOutputDataHandling().getOutputDataDir();
if(outputDataDirectory != null && !"".equals(outputDataDirectory)){
stageOutputFiles(jobExecutionContext,outputDataDirectory);
}
}
} catch (ToolsException e) {
log.error(e.getMessage());
throw new GFacHandlerException(e.getMessage() + "\n StdError Data: \n" +readLastLinesofStdOut(localStdErrFile.getPath(), 20),e);
} catch (URISyntaxException e) {
log.error(e.getMessage());
throw new GFacHandlerException("URI is malformatted:" + e.getMessage(), e, readLastLinesofStdOut(localStdErrFile.getPath(), 20));
}
}
} catch (Exception e) {
try {
status.setTransferState(TransferState.FAILED);
detail.setTransferStatus(status);
registry.add(ChildDataType.DATA_TRANSFER_DETAIL,detail, jobExecutionContext.getTaskData().getTaskID());
GFacUtils.saveErrorDetails(jobExecutionContext, e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.FILE_SYSTEM_FAILURE);
} catch (Exception e1) {
throw new GFacHandlerException("Error persisting status", e1, e1.getLocalizedMessage());
}
log.error(e.getMessage());
throw new GFacHandlerException(e.getMessage(), e, readLastLinesofStdOut(localStdErrFile.getPath(), 20));
}
}