Author: jim.ma
Date: 2012-11-13 09:56:46 -0500 (Tue, 13 Nov 2012)
New Revision: 16972
Modified:
stack/native/tags/jbossws-native-3.1.2.SP14/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java
stack/native/tags/jbossws-native-3.1.2.SP14/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
Log:
Revert the wrong commit in tag, should do another release
Modified:
stack/native/tags/jbossws-native-3.1.2.SP14/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java
===================================================================
---
stack/native/tags/jbossws-native-3.1.2.SP14/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java 2012-11-13
14:45:27 UTC (rev 16971)
+++
stack/native/tags/jbossws-native-3.1.2.SP14/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xsd/SchemaUtils.java 2012-11-13
14:56:46 UTC (rev 16972)
@@ -513,7 +513,7 @@
/** Get the temp file for a given namespace
*/
- public static File getSchemaTempFile(String targetNS, byte[] fileContent) throws
IOException
+ public static File getSchemaTempFile(String targetNS, String fileName) throws
IOException
{
if (targetNS.length() == 0)
throw new IllegalArgumentException("Invalid null target namespace");
@@ -544,11 +544,11 @@
fname = fname.replace('#', '_');
File file = null;
- if (fileContent != null)
+ if (fileName != null)
{
try
{
- String fileNameHash =
toHexString(MessageDigest.getInstance("MD5").digest(fileContent));
+ String fileNameHash =
toHexString(MessageDigest.getInstance("MD5").digest(fileName.getBytes("UTF-8")));
if(tmpdir == null)
{
tmpdir = (File) AccessController.doPrivileged(new PrivilegedAction() {
Modified:
stack/native/tags/jbossws-native-3.1.2.SP14/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
===================================================================
---
stack/native/tags/jbossws-native-3.1.2.SP14/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2012-11-13
14:45:27 UTC (rev 16971)
+++
stack/native/tags/jbossws-native-3.1.2.SP14/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2012-11-13
14:56:46 UTC (rev 16972)
@@ -21,14 +21,10 @@
*/
package org.jboss.ws.tools.wsdl;
-import java.io.ByteArrayOutputStream;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
-import java.io.InputStream;
import java.net.MalformedURLException;
-import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
@@ -113,7 +109,6 @@
import org.jboss.ws.tools.JavaToXSD;
import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.common.DOMWriter;
-import org.jboss.wsf.common.IOUtils;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
@@ -272,8 +267,7 @@
{
for (File current : tempFiles)
{
- //TODO: look at how to remove tmp file correctly
- //current.delete();
+ current.deleteOnExit();
}
}
@@ -536,17 +530,6 @@
importElement.setAttribute("namespace", Constants.URI_SOAP11_ENC);
schemaEl.insertBefore(importElement, DOMUtils.getFirstChildElement(schemaEl));
- byte[] wsdlContent = null;
-
- InputStream inputStream = wsdlLoc.openStream();
-
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- IOUtils.copyStream(bout, inputStream);
- wsdlContent = bout.toByteArray();
- inputStream.close();
- bout.close();
-
-
String targetNS = getOptionalAttribute(schemaEl, "targetNamespace");
File tmpFile = null;
@@ -561,14 +544,14 @@
{
log.trace("processSchemaInclude: [targetNS=" + targetNS +
",parentURL=" + wsdlLoc + "]");
- tmpFile = SchemaUtils.getSchemaTempFile(targetNS, wsdlContent);
+ tmpFile = SchemaUtils.getSchemaTempFile(targetNS, getFileName(wsdlLoc));
tempFiles.add(tmpFile);
publishedLocations.put(wsdlLoc, tmpFile.toURL());
}
else
{
- tmpFile = SchemaUtils.getSchemaTempFile("no_namespace", wsdlContent);
+ tmpFile = SchemaUtils.getSchemaTempFile("no_namespace",
getFileName(wsdlLoc));
tempFiles.add(tmpFile);
publishedLocations.put(wsdlLoc, tmpFile.toURL());
Show replies by date