cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5849] Setting systemId on individual XSLT templates, patch from Vjacheslav Borisov applied
Date Mon, 07 Jul 2014 10:17:00 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 3cd2f8f4a -> 58f2f57e7


[CXF-5849] Setting systemId on individual XSLT templates, patch from Vjacheslav Borisov applied


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/58f2f57e
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/58f2f57e
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/58f2f57e

Branch: refs/heads/master
Commit: 58f2f57e72f50d8abfce6e0aae95d1c09d0fb038
Parents: 3cd2f8f
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Mon Jul 7 11:16:43 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Mon Jul 7 11:16:43 2014 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/provider/XSLTJaxbProvider.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/58f2f57e/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/XSLTJaxbProvider.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/XSLTJaxbProvider.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/XSLTJaxbProvider.java
index 34713cb..304f595 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/XSLTJaxbProvider.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/XSLTJaxbProvider.java
@@ -25,6 +25,7 @@ import java.io.OutputStream;
 import java.io.Reader;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
+import java.net.URL;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -177,7 +178,7 @@ public class XSLTJaxbProvider<T> extends JAXBElementProvider<T>
{
                 }
                 t = createTemplates(path);
                 if (t == null) {
-                    createTemplates(ClassLoaderUtils.getResourceAsStream(ann.value(), cls));
+                    createTemplates(ClassLoaderUtils.getResource(ann.value(), cls));
                 }
                 if (t != null) {
                     annotationTemplates.putIfAbsent(ann.value(), t);
@@ -479,22 +480,23 @@ public class XSLTJaxbProvider<T> extends JAXBElementProvider<T>
{
     
     protected Templates createTemplates(String loc) {
         try {
-            return createTemplates(ResourceUtils.getResourceStream(loc, this.getBus()));
+            return createTemplates(ResourceUtils.getResourceURL(loc, this.getBus()));
         } catch (Exception ex) {
             LOG.warning("No template can be created : " + ex.getMessage());
         }
         return null;
     }
     
-    protected Templates createTemplates(InputStream is) {
+    protected Templates createTemplates(URL urlStream) {
         try {
-            if (is == null) {
+            if (urlStream == null) {
                 return null;
             }
             
             Reader r = new BufferedReader(
-                           new InputStreamReader(is, "UTF-8"));
+                           new InputStreamReader(urlStream.openStream(), "UTF-8"));
             Source source = new StreamSource(r);
+            source.setSystemId(urlStream.toExternalForm());
             if (factory == null) {
                 factory = (SAXTransformerFactory)TransformerFactory.newInstance();
                 if (uriResolver != null) {


Mime
View raw message