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 !!