Coverage report

| %line | %branch
--- | --- | ---
com.ozacc.mail.impl.DTDEntityResolver |
81% |
89% |

1 |  |
     package com.ozacc.mail.impl;
2 |  |
3 |  |
     import java.io.IOException;
4 |  |
     import java.io.InputStream;
5 |  |
6 |  |
     import org.apache.commons.logging.Log;
7 |  |
     import org.apache.commons.logging.LogFactory;
8 |  |
     import org.xml.sax.EntityResolver;
9 |  |
     import org.xml.sax.InputSource;
10 |  |
     import org.xml.sax.SAXException;
11 |  |
12 |  |
     /**
13 |  |
      * ozacc-mail library¤ÎDTD¥Õ¥¡¥¤¥?¤ò¥¯¥é¥¹¥Ñ¥¹¾å¤«¤é¸¡½Ð¤¹¤?EntityResolver¼ÂÁõ¡£
14 |  |
      *
15 |  |
      * @since 1.1
16 |  |
      *
17 |  |
      * @author Tomohiro Otsuka
18 |  |
      * @version $Id: DTDEntityResolver.java,v 1.1.2.2 2004/11/25 08:01:07 otsuka Exp $
19 |  |
      */
20 | 48 |
     public class DTDEntityResolver implements EntityResolver {
21 |  |
22 | 4 |
     	private static Log log = LogFactory.getLog(DTDEntityResolver.class);
23 |  |
24 |  |
     	private static final String URL = "http://www.ozacc.com/library/dtd/";
25 |  |
26 |  |
     	/**
27 |  |
     	 * ¥¯¥é¥¹¥Ñ¥¹¡Öcom/ozacc/mail¡×¾å¤Ç¡¢»ØÄê¤µ¤?¤¿systemId¤Î¥Õ¥¡¥¤¥?Ì¾¤ÈÆ±¤¸¥Õ¥¡¥¤¥?¤ò¸¡½Ð¤·¤Þ¤¹¡£
28 |  |
     	 * ¤â¤·¤â¸¡½Ð¤Ç¤¤Ê¤±¤?¤Ðnull¤òÊÖ¤·¤Þ¤¹¡£(É¬¤º¸¡½Ð¤Ç¤¤?¤Ï¤º¤Ç¤¹¡£)
29 |  |
     	 *
30 |  |
     	 * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String)
31 |  |
     	 */
32 |  |
     	public InputSource resolveEntity(String class="keyword">publicId, String systemId) throws SAXException,
33 |  |
     																		IOException {
34 | 52 |
     		if (systemId != null && systemId.startsWith(URL)) {
35 | 52 |
     			log.debug("¥¯¥é¥¹¥Ñ¥¹[com/ozacc/mail/]¾å¤Ç'" + systemId + "'¤Î¼èÆÀ¤ò»ûÀß¤Þ¤¹¡£");
36 |  |
37 |  |
     			// Search for DTD
38 | 52 |
     			ClassLoader classLoader = this.getClass().getClassLoader();
39 | 156 |
     			InputStream dtdStream = classLoader.getResourceAsStream("com/ozacc/mail/"
40 | 52 |
     					+ systemId.substring(URL.length()));
41 |  |
42 | 52 |
     			if (dtdStream == null) {
43 | 0 |
     				log.debug("'" + systemId + "'¤Ï¥¯¥é¥¹¥Ñ¥¹¾å¤Ë¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£");
44 | 0 |
     				return null;
45 |  |
     			} else {
46 | 52 |
     				log.debug("'" + systemId + "'¤ò¥¯¥é¥¹¥Ñ¥¹¾å¤Ç¼èÆÀ¤·¤Þ¤·¤¿¡£");
47 | 52 |
     				InputSource source = new InputSource(dtdStream);
48 | 52 |
     				source.setPublicId(publicId);
49 | 52 |
     				source.setSystemId(systemId);
50 | 52 |
     				return source;
51 |  |
     			}
52 |  |
     		} else {
53 |  |
     			// use the default behaviour
54 | 0 |
     			return null;
55 |  |
     		}
56 |  |
     	}
57 |  |
58 |  |
     }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.