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
This commit is contained in:
Olivier Lamy 2012-10-08 15:50:30 +00:00
parent cd6239cef0
commit 76fd653c09
1 changed files with 7 additions and 0 deletions

View File

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