You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2007/06/22 04:52:39 UTC
svn commit: r549676 -
/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/WSDL4JWrapper.java
Author: dims
Date: Thu Jun 21 19:52:38 2007
New Revision: 549676
URL: http://svn.apache.org/viewvc?view=rev&rev=549676
Log:
Fix for AXIS2-2838 - JAX-WS Metadata WSDL4JWrapper Java2 security updates
Modified:
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/WSDL4JWrapper.java
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/WSDL4JWrapper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/WSDL4JWrapper.java?view=diff&rev=549676&r1=549675&r2=549676
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/WSDL4JWrapper.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/util/WSDL4JWrapper.java Thu Jun 21 19:52:38 2007
@@ -122,7 +122,7 @@
URLConnection urlCon = url.openConnection();
InputStream is = null;
try {
- is = urlCon.getInputStream();
+ is = getInputStream(urlCon);
}
catch(IOException e) {
if(log.isDebugEnabled()) {
@@ -476,6 +476,29 @@
public String getTargetNamespace() {
// TODO Auto-generated method stub
return wsdlDefinition.getTargetNamespace();
+ }
+
+ /**
+ * This method provides a Java2 Security compliant way to obtain the InputStream
+ * for a given URLConnection object. This is needed as a given URLConnection object
+ * may be an instance of a FileURLConnection object which would require access
+ * permissions if Java2 Security was enabled.
+ */
+ private InputStream getInputStream(URLConnection urlCon) throws Exception {
+ final URLConnection finalURLCon = urlCon;
+ InputStream is = null;
+ try {
+ is = (InputStream) AccessController.doPrivileged(
+ new PrivilegedExceptionAction() {
+ public Object run() throws IOException {
+ return finalURLCon.getInputStream();
+ }
+ });
+ }
+ catch(PrivilegedActionException e) {
+ throw e.getException();
+ }
+ return is;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org