[Yanel-commits] rev 25706 - public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils

simon at wyona.com simon at wyona.com
Tue Jul 3 11:13:50 CEST 2007


Author: simon
Date: 2007-07-03 11:13:49 +0200 (Tue, 03 Jul 2007)
New Revision: 25706

Modified:
   public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/TomcatContextHandler.java
Log:
some small issues fixed

Modified: public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/TomcatContextHandler.java
===================================================================
--- public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/TomcatContextHandler.java	2007-07-03 08:24:39 UTC (rev 25705)
+++ public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/TomcatContextHandler.java	2007-07-03 09:13:49 UTC (rev 25706)
@@ -59,17 +59,19 @@
         Map contextAndWebapps = new HashMap();
         for (int i = 0; i < this.contextConfDirectory.listFiles().length; i++) {
             String context = this.contextConfDirectory.listFiles()[i].getName().replaceAll(".xml", "");;
+            String webapp = getWebappOfContext(context);
             if (context.equals("ROOT")) {
                 context = "/";
             }
-            String webapp = getWebappOfContext(context);
-            contextAndWebapps.put(context, webapp);
+            if (webapp != "") {
+                contextAndWebapps.put(context, webapp);
+            }
         }
         return contextAndWebapps;
     }
     
     public String getWebappOfContext (String context) throws FileNotFoundException, IOException {
-        File file = new File( contextConfPath +  context);
+        File file = new File( contextConfPath +  context + ".xml");
         String line = "";
         String webapp = "";
 
@@ -82,10 +84,12 @@
         fis.close();
         bis.close();
         dis.close();
-        
+        if (line.indexOf("yanel-webapps") <= 0) {
+            return "";
+        }
         line = line.replaceAll("[ ]+", " ");
         line = line.replaceAll("\"/>", "");
-        webapp = line.split(File.separator)[line.split(File.separator).length];
+        webapp = line.split(File.separator)[line.split(File.separator).length -1 ];
         
         return webapp;
     }




More information about the Yanel-commits mailing list