[Yanel-commits] rev 25841 - 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
Mon Jul 9 17:47:06 CEST 2007


Author: simon
Date: 2007-07-09 17:47:06 +0200 (Mon, 09 Jul 2007)
New Revision: 25841

Modified:
   public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/TomcatContextHandler.java
Log:
getContextsOfWebapp() 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-09 15:45:08 UTC (rev 25840)
+++ public/yanel/trunk/src/realms/welcome-admin/yanel/resources/update-webapp/src/java/org/wyona/yanel/impl/resources/updatefinder/utils/TomcatContextHandler.java	2007-07-09 15:47:06 UTC (rev 25841)
@@ -111,13 +111,9 @@
     */
     public ArrayList getContextsOfWebapp (String webapp) throws FileNotFoundException, IOException {
         ArrayList contexts = new ArrayList();
-        File file = new File( webappsDirectory +  webapp );
-        if(!file.exists()) {
-            return null;
-        }
         for (int i = 0; i < this.contextConfDirectory.listFiles().length; i++) {
             String line = "";
-            FileInputStream fis = new FileInputStream(file);
+            FileInputStream fis = new FileInputStream(contextConfDirectory.listFiles()[i]);
             BufferedInputStream  bis = new BufferedInputStream(fis);
             DataInputStream  dis = new DataInputStream(bis);
             while (dis.available() != 0) {
@@ -127,7 +123,7 @@
             bis.close();
             dis.close();
             if (line.indexOf(webapp) > 0){
-                contexts.add(file.getName().replaceAll(".xml", ""));
+                contexts.add(contextConfDirectory.listFiles()[i].getName().replaceAll(".xml", ""));
             }
         }
         if (contexts.size() < 1) {




More information about the Yanel-commits mailing list