Web services status checking servlets, new clustalo x32 binary from Fabian, other...
[jabaws.git] / webservices / compbio / stat / servlet / Joblist.java
index 7328e28..70f61b9 100644 (file)
@@ -1,5 +1,23 @@
+/* Copyright (c) 2011 Peter Troshin\r
+ *  \r
+ *  JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0     \r
+ * \r
+ *  This library is free software; you can redistribute it and/or modify it under the terms of the\r
+ *  Apache License version 2 as published by the Apache Software Foundation\r
+ * \r
+ *  This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\r
+ *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache \r
+ *  License for more details.\r
+ * \r
+ *  A copy of the license is in apache_license.txt. It is also available here:\r
+ * @see: http://www.apache.org/licenses/LICENSE-2.0.txt\r
+ * \r
+ * Any republication or derived work distributed in source code form\r
+ * must include this copyright and license notice.\r
+ */\r
 package compbio.stat.servlet;\r
 \r
+import java.io.File;\r
 import java.io.IOException;\r
 import java.sql.SQLException;\r
 import java.sql.Timestamp;\r
@@ -11,10 +29,9 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;\r
 import javax.servlet.http.HttpSession;\r
 \r
-import compbio.engine.conf.PropertyHelperManager;\r
+import compbio.engine.client.PathValidator;\r
 import compbio.stat.collector.StatDB;\r
 import compbio.stat.collector.StatProcessor;\r
-import compbio.util.PropertyHelper;\r
 import compbio.util.Util;\r
 import compbio.ws.client.Services;\r
 \r
@@ -92,11 +109,23 @@ public class Joblist extends HttpServlet {
                        throw new ServletException("'toDate' is not specified!");\r
                }\r
 \r
-               PropertyHelper helper = PropertyHelperManager.getPropertyHelper();\r
-               String clusterTempDir = helper.getProperty("cluster.tmp.directory")\r
-                               .trim();\r
-               String localTempDir = helper.getProperty("local.tmp.directory").trim();\r
-               // TODO include the time slice\r
+               // Just extract the last name from the path\r
+               String clusterTempDir = StatisticCollector.getClusterJobDir();\r
+               if (!Util.isEmpty(clusterTempDir)) {\r
+                       clusterTempDir = new File(clusterTempDir).getName();\r
+               } else {\r
+                       clusterTempDir = "";\r
+               }\r
+               // Just extract the last name from the path\r
+               String localTempDir = StatisticCollector.getLocalJobDir();\r
+               if (!Util.isEmpty(localTempDir)) {\r
+                       if (PathValidator.isAbsolutePath(localTempDir)) {\r
+                               localTempDir = new File(localTempDir).getName();\r
+                       }\r
+               } else {\r
+                       localTempDir = "";\r
+               }\r
+\r
                Timestamp startDate = new Timestamp(Long.parseLong(fromDate));\r
                Timestamp stopDate = new Timestamp(Long.parseLong(toDate));\r
                StatDB statdb = null;\r
@@ -135,7 +164,7 @@ public class Joblist extends HttpServlet {
                } catch (SQLException e) {\r
                        e.printStackTrace();\r
                        throw new ServletException("SQLException : "\r
-                                       + e.getLocalizedMessage());\r
+                                       + e.getLocalizedMessage(), e);\r
                }\r
 \r
        }\r