提交 a790701f 编写于 作者: K kohsuke

let's stick to WS instead of TAB


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@7550 71c3de6d-444a-0410-be80-ed276b4c234a
上级 28663c15
......@@ -23,28 +23,28 @@ import java.util.logging.Logger;
*/
class XMLEntityResolver implements EntityResolver {
private static final String TESTNG_NAMESPACE = "http://testng.org/";
private static final String TESTNG_NAMESPACE = "http://testng.org/";
/**
* Intercepts the lookup of publicId, systemId
*/
/**
* Intercepts the lookup of publicId, systemId
*/
@Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
if (systemId != null) {
LOGGER.fine("Will try to resolve systemId [" + systemId + "]");
// TestNG system-ids
if ( systemId.startsWith( TESTNG_NAMESPACE ) ) {
LOGGER.fine( "It's a TestNG document, will try to lookup DTD in classpath" );
String dtdFileName = systemId.substring( TESTNG_NAMESPACE.length() );
if (systemId != null) {
LOGGER.fine("Will try to resolve systemId [" + systemId + "]");
// TestNG system-ids
if (systemId.startsWith(TESTNG_NAMESPACE)) {
LOGGER.fine("It's a TestNG document, will try to lookup DTD in classpath");
String dtdFileName = systemId.substring(TESTNG_NAMESPACE.length());
URL url = Hudson.getInstance().servletContext.getResource('/'+dtdFileName);
if(url!=null)
URL url = Hudson.getInstance().servletContext.getResource('/' + dtdFileName);
if (url != null)
return new InputSource(url.toString());
}
}
// Default fallback
return null;
}
}
// Default fallback
return null;
}
private static final Logger LOGGER = Logger.getLogger( XMLEntityResolver.class.getName() );
private static final Logger LOGGER = Logger.getLogger(XMLEntityResolver.class.getName() );
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册