From: Olivier Lamy Date: Mon, 8 Oct 2012 15:50:30 +0000 (+0000) Subject: return schema .xsd as it no jsoup parsing X-Git-Tag: archiva-1.4-M4~799 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=76fd653c0996345da83ee19f06eac17e9cd490f4;p=archiva.git return schema .xsd as it no jsoup parsing git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1395628 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java index 76cf0667f..097de9641 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/docs/RestDocsServlet.java @@ -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 !!