Author: lukaszlenart
Date: Tue May  8 12:28:02 2012
New Revision: 1335463

URL: http://svn.apache.org/viewvc?rev=1335463&view=rev
Log:
WW-3810 reverts support for JBoss 5.1

Modified:
    
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/URLUtil.java

Modified: 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/URLUtil.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/URLUtil.java?rev=1335463&r1=1335462&r2=1335463&view=diff
==============================================================================
--- 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/URLUtil.java
 (original)
+++ 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/URLUtil.java
 Tue May  8 12:28:02 2012
@@ -124,9 +124,13 @@ public class URLUtil {
     public static URL getJBossPhysicalUrl(URL url) throws IOException {
         Object content = url.openConnection().getContent();
         try {
-            if (content.getClass().toString().startsWith("class 
org.jboss.vfs.VirtualFile")) {
+            String s = content.getClass().toString();
+            if (s.startsWith("class org.jboss.vfs.VirtualFile")) { // JBoss 7 
and probably JBoss 6
                 File physicalFile = readJBossPhysicalFile(content);
                 return physicalFile.toURI().toURL();
+            } else if (s.startsWith("class org.jboss.virtual.VirtualFile")) { 
// JBoss 5
+                String fileName = url.toExternalForm();
+                return new URL("file", null, 
fileName.substring(fileName.indexOf(":") + 1));
             }
         } catch (Exception e) {
             LOG.warn("Error calling getPhysicalFile() on JBoss VirtualFile.", 
e);


Reply via email to