X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webservices%2Fcompbio%2Fstat%2Fservlet%2FJoblist.java;h=70f61b9f8ced20d4e6941223dc636147172c869c;hb=9a716f092cba84e5b68c5eb3371fdcf31857a715;hp=4ceb2b800d87192ec98eed9728065fead9a9bd05;hpb=5289bedee673d95739fdf622dba7be64f8c2df13;p=jabaws.git diff --git a/webservices/compbio/stat/servlet/Joblist.java b/webservices/compbio/stat/servlet/Joblist.java index 4ceb2b8..70f61b9 100644 --- a/webservices/compbio/stat/servlet/Joblist.java +++ b/webservices/compbio/stat/servlet/Joblist.java @@ -1,3 +1,20 @@ +/* Copyright (c) 2011 Peter Troshin + * + * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 + * + * This library is free software; you can redistribute it and/or modify it under the terms of the + * Apache License version 2 as published by the Apache Software Foundation + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache + * License for more details. + * + * A copy of the license is in apache_license.txt. It is also available here: + * @see: http://www.apache.org/licenses/LICENSE-2.0.txt + * + * Any republication or derived work distributed in source code form + * must include this copyright and license notice. + */ package compbio.stat.servlet; import java.io.File; @@ -12,10 +29,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import compbio.engine.conf.PropertyHelperManager; +import compbio.engine.client.PathValidator; import compbio.stat.collector.StatDB; import compbio.stat.collector.StatProcessor; -import compbio.util.PropertyHelper; import compbio.util.Util; import compbio.ws.client.Services; @@ -93,12 +109,23 @@ public class Joblist extends HttpServlet { throw new ServletException("'toDate' is not specified!"); } - PropertyHelper helper = PropertyHelperManager.getPropertyHelper(); - String clusterTempDir = helper.getProperty("cluster.tmp.directory") - .trim(); - clusterTempDir = new File(clusterTempDir).getName(); - String localTempDir = helper.getProperty("local.tmp.directory").trim(); - // TODO include the time slice + // Just extract the last name from the path + String clusterTempDir = StatisticCollector.getClusterJobDir(); + if (!Util.isEmpty(clusterTempDir)) { + clusterTempDir = new File(clusterTempDir).getName(); + } else { + clusterTempDir = ""; + } + // Just extract the last name from the path + String localTempDir = StatisticCollector.getLocalJobDir(); + if (!Util.isEmpty(localTempDir)) { + if (PathValidator.isAbsolutePath(localTempDir)) { + localTempDir = new File(localTempDir).getName(); + } + } else { + localTempDir = ""; + } + Timestamp startDate = new Timestamp(Long.parseLong(fromDate)); Timestamp stopDate = new Timestamp(Long.parseLong(toDate)); StatDB statdb = null;