Revision: 1217
          http://stripes.svn.sourceforge.net/stripes/?rev=1217&view=rev
Author:   bengunter
Date:     2009-11-10 14:16:48 +0000 (Tue, 10 Nov 2009)

Log Message:
-----------
Applied fix for STS-723 from 1.5.x branch.

Modified Paths:
--------------
    trunk/stripes/src/net/sourceforge/stripes/util/ResolverUtil.java

Modified: trunk/stripes/src/net/sourceforge/stripes/util/ResolverUtil.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/util/ResolverUtil.java    
2009-11-04 15:51:39 UTC (rev 1216)
+++ trunk/stripes/src/net/sourceforge/stripes/util/ResolverUtil.java    
2009-11-10 14:16:48 UTC (rev 1217)
@@ -409,19 +409,41 @@
             log.trace("Extracted JAR URL: ", jarUrl);
         }
         else {
+            log.trace("Not a JAR: ", jarUrl);
             return null;
         }
 
         // Try to open and test it
         try {
             URL testUrl = new URL(jarUrl.toString());
-            if (isJar(testUrl))
+            if (isJar(testUrl)) {
                 return testUrl;
+            }
+            else {
+                // WebLogic fix: check if the URL's file exists in the 
filesystem.
+                log.trace("Not a JAR: ", jarUrl);
+                jarUrl.replace(0, jarUrl.length(), testUrl.getFile());
+                File file = new File(jarUrl.toString());
+
+                // File name might be URL-encoded
+                if (!file.exists()) {
+                    file = new File(StringUtil.urlDecode(jarUrl.toString()));
+                }
+
+                if (file.exists()) {
+                    log.trace("Trying real file: ", file.getAbsolutePath());
+                    testUrl = file.toURI().toURL();
+                    if (isJar(testUrl)) {
+                        return testUrl;
+                    }
+                }
+            }
         }
         catch (MalformedURLException e) {
             log.warn("Invalid JAR URL: ", jarUrl);
         }
 
+        log.trace("Not a JAR: ", jarUrl);
         return null;
     }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to