DtdEntityResolver implements EntityResolver { public InputSource resolveEntity( final String publicId, final String systemId ) throws SAXException, IOException { int idx = systemId.lastIndexOf( '/' ); String dtdName = systemId.substring( idx + 1 ); try { File f = new File( AppConfigProperties.getInstance().getSolutionPath() + "/system/dtd/" + dtdName ); if ( f.exists() && f.isFile() ) { return new InputSource( new FileInputStream( f ) ); } } catch ( IOException e ) { } return null; }  InputSource resolveEntity( final String publicId, final String systemId );  }
@Test public void testResolveEntity() throws Exception { DtdEntityResolver entityResolver = new DtdEntityResolver(); InputSource inputSource = entityResolver.resolveEntity( "id", "system/sid" ); assertNull( inputSource ); }