}
private void makeDirectory(JobExecutionContext context) throws GFacHandlerException,GFacException {
SSHSecurityContext securityContext = (SSHSecurityContext)context.getSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT);
ApplicationDeploymentDescriptionType app = context.getApplicationContext().getApplicationDeploymentDescription().getType();
Session session = null;
try {
session = securityContext.getSession(context.getApplicationContext().getHostDescription().getType().getHostAddress());
StringBuilder commandString = new StringBuilder();
commandString.append("mkdir -p ");
commandString.append(app.getScratchWorkingDirectory());
commandString.append(" ; ");
commandString.append("mkdir -p ");
commandString.append(app.getStaticWorkingDirectory());
commandString.append(" ; ");
commandString.append("mkdir -p ");
commandString.append(app.getInputDataDirectory());
commandString.append(" ; ");
commandString.append("mkdir -p ");
commandString.append(app.getOutputDataDirectory());
Command cmd = session.exec(commandString.toString());
cmd.join(Constants.COMMAND_EXECUTION_TIMEOUT, TimeUnit.SECONDS);
} catch (ConnectionException e) {
throw new GFacHandlerException(e.getMessage(), e, context);
} catch (TransportException e) {
throw new GFacHandlerException(e.getMessage(), e, context);