From 76fd653c0996345da83ee19f06eac17e9cd490f4 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 8 Oct 2012 15:50:30 +0000 Subject: [PATCH] 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 --- .../java/org/apache/archiva/web/docs/RestDocsServlet.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 !! -- 2.39.5