You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by wo...@apache.org on 2008/04/05 22:41:45 UTC

svn commit: r645173 - in /webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws: description/builder/JAXWSRIWSDLGenerator.java util/CatalogURIResolver.java

Author: woodroy
Date: Sat Apr  5 13:41:39 2008
New Revision: 645173

URL: http://svn.apache.org/viewvc?rev=645173&view=rev
Log:
Add doPriv's around file.exists() and file.isdir()
contributor: Roy Wood

Modified:
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/CatalogURIResolver.java

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java?rev=645173&r1=645172&r2=645173&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java Sat Apr  5 13:41:39 2008
@@ -536,7 +536,7 @@
     private static void addPath(HashSet classpath, String s) {
         String path = s.replace(((File.separatorChar == '/') ? '\\' : '/'), File.separatorChar).trim();
         File file = new File(path);
-        if (file.exists()) {
+        if (fileExists(file)) {
             path = file.getAbsolutePath();
             classpath.add(path);
         }
@@ -654,4 +654,16 @@
             return (name.endsWith(".jar") || name.endsWith(".zip"));
         }
     }
+    
+    static private Boolean fileExists (final File file) {
+        Boolean exists = (Boolean) AccessController.doPrivileged(
+                new PrivilegedAction() {
+                    public Object run() {
+                        return new Boolean(file.exists());
+                    }
+                }
+        );
+        return exists;
+    }
+    
 }

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/CatalogURIResolver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/CatalogURIResolver.java?rev=645173&r1=645172&r2=645173&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/CatalogURIResolver.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/CatalogURIResolver.java Sat Apr  5 13:41:39 2008
@@ -19,6 +19,7 @@
 
 package org.apache.axis2.jaxws.util;
 
+import org.apache.axis2.java.security.AccessController;
 import org.apache.axis2.jaxws.catalog.JAXWSCatalogManager;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -32,6 +33,7 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
+import java.security.PrivilegedAction;
 
 
 /**
@@ -99,7 +101,9 @@
             try
             {
                 File baseFile = new File(baseUri);
-                if (baseFile.exists()) baseUri = baseFile.toURI().toString();
+                
+                
+                if (fileExists(baseFile)) baseUri = baseFile.toURI().toString();
                 
                 String ref = new URI(baseUri).resolve(new URI(schemaLocation)).toString();
 
@@ -206,4 +210,29 @@
 
         return new URL("file", "", path);
     }    // getFileURL
+    
+    
+    private Boolean fileExists (final File file) {
+        Boolean exists = (Boolean) AccessController.doPrivileged(
+                new PrivilegedAction() {
+                    public Object run() {
+                        return new Boolean(file.exists());
+                    }
+                }
+        );
+        return exists;
+    }
+    
+    private Boolean fileIsDirectory(final File file) {
+        Boolean isDir = (Boolean) AccessController.doPrivileged(
+                new PrivilegedAction() {
+                    public Object run() {
+                        return new Boolean(file.isDirectory());
+                    }
+                }
+        );
+        return isDir;
+    }
+
+
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org