You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2018/01/08 15:46:53 UTC

svn commit: r1820574 - /cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java

Author: dkulp
Date: Mon Jan  8 15:46:53 2018
New Revision: 1820574

URL: http://svn.apache.org/viewvc?rev=1820574&view=rev
Log:
Update to look for templates relative to the cfg file as well as in classloader

Modified:
    cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java

Modified: cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java
URL: http://svn.apache.org/viewvc/cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java?rev=1820574&r1=1820573&r2=1820574&view=diff
==============================================================================
--- cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java (original)
+++ cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java Mon Jan  8 15:46:53 2018
@@ -197,8 +197,21 @@ public class SiteExporter implements Run
             File file = new File(templateName);
             if (file.exists()) {
                 url = file.toURI().toURL();
+            } else {
+                //try relative to this cfg file
+                file = new File(fileName);
+                file = new File(file.getParentFile().toURI().resolve(templateName));
+                if (file.exists()) {
+                    url = file.toURI().toURL();
+                }
             }
         }
+        if (url == null) {
+            File file = new File(fileName);
+            file = new File(file.getParentFile().toURI().resolve(templateName));
+            System.err.println("Could not find " + templateName + "   " + fileName);
+            System.err.println("               " + file.toURI().toURL());
+        }
         template = engine.getTemplate(url.toURI().toString());
                
         outputDir.mkdirs();