package compbio.controllers;
import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
* @param model
* MVC model
* @return link to the JSP query page
+ * @throws IOException
*/
@RequestMapping(value = "/job/results", method = RequestMethod.GET)
- public String findJob(@RequestParam("IdJob") String jobid, Map<String, Object> model) {
+ public String findJob(@RequestParam("IdJob") String jobid, Map<String, Object> model) throws IOException {
model.put("username", getPrincipalName());
final long startTime = System.currentTimeMillis();
JobReader reader = new JobReader();
log.error("JobController.prepareJobArchiveToWeb: IO exception with job archive file");
log.error(e.getLocalizedMessage(), e.getCause());
}
+ // add a direct link to the job
+ String remotelink = "http://www.compbio.dundee.ac.uk/www-jpred/results/" + jobid + "/" + jobid + ".results.html";
+ URL remotelinkurl = new URL(remotelink);
+ HttpURLConnection httpConnection_remotelinkurl = (HttpURLConnection) remotelinkurl.openConnection();
+ if (199 < httpConnection_remotelinkurl.getResponseCode() && httpConnection_remotelinkurl.getResponseCode() < 300) {
+ model.put("jobremotelink", remotelink);
+ }
return "reports/Job";
}