]> source.dussan.org Git - archiva.git/commitdiff
return schema .xsd as it no jsoup parsing
authorOlivier Lamy <olamy@apache.org>
Mon, 8 Oct 2012 15:50:30 +0000 (15:50 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 8 Oct 2012 15:50:30 +0000 (15:50 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1395628 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java

index 76cf0667f78622a4ffbb2a2147934c464ee6c2b0..097de96417b03862c48e668354cd57f858573869 100644 (file)
@@ -18,6 +18,7 @@ package org.apache.archiva.web.docs;
  * under the License.
  */
 
+import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringUtils;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
@@ -53,6 +54,12 @@ public class RestDocsServlet
         String path = StringUtils.removeStart( req.getPathInfo(), "/" );
         InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream( path );
 
+        if ( StringUtils.endsWith( path, ".xsd" ) )
+        {
+            IOUtils.copy( is, resp.getOutputStream() );
+            return;
+        }
+
         String startPath = StringUtils.substringBefore( path, "/" );
 
         // replace all links !!