harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r548907 - /harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/DefaultPolicyParser.java
Date Wed, 20 Jun 2007 03:17:38 GMT
Author: leoli
Date: Tue Jun 19 20:17:37 2007
New Revision: 548907

URL: http://svn.apache.org/viewvc?view=rev&rev=548907
Log:
Fix HARMONY-4184.

Modified:
    harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/DefaultPolicyParser.java

Modified: harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/DefaultPolicyParser.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/DefaultPolicyParser.java?view=diff&rev=548907&r1=548906&r2=548907
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/DefaultPolicyParser.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/fortress/DefaultPolicyParser.java
Tue Jun 19 20:17:37 2007
@@ -198,8 +198,17 @@
             if ("file".equals(codebase.getProtocol())) { //$NON-NLS-1$
             	File codeFile = new File(codebase.getFile());
             	if (codeFile.isAbsolute()) {
-            		codebase = new URL("file://" +  //$NON-NLS-1$
-                            codeFile.getAbsolutePath());            		
+                    String absolutePath = codeFile.getAbsolutePath();
+                    //Fix HARMONY-4184
+                    //Unix style file path.
+                    if (absolutePath.startsWith("/")) {
+                        codebase = new URL("file://" + //$NON-NLS-1$
+                                codeFile.getAbsolutePath());
+                    } else {
+                        //Windows style file path.                        
+                        codebase = new URL("file:/" + //$NON-NLS-1$
+                                codeFile.getAbsolutePath());
+                    }           		
             	}
             }
         }



Mime
View raw message