class PivotalEntityResolver extends DefaultEntityResolver2 {

  @Override
  public InputSource resolveEntity(final String name, final String publicId, final String baseURI,
      final String systemId) throws SAXException, IOException {
    if (null == systemId) {
      return null;
    }

    Matcher matcher = SYSTEM_ID_ROOT.matcher(systemId);
    if (matcher.find()) {
      return getClassPathInputSource(publicId, systemId, matcher.replaceFirst(CLASSPATH_ROOT));
    }

    return null;
  }

}