Code example for URL

Methods: getFile, getHost

0
      SAXException, IOException { 
    if (systemId == null) {
      return null; 
    } 
 
    URL url = new URL(systemId);
    String file = url.getFile();
 
    if ( (file != null) && (file.indexOf('/') > -1)) {
      file = file.substring(file.lastIndexOf('/') + 1);
    } 
 
    if ("www.jdon.com".equals(url.getHost())) {
      InputStream is = getClass().getResourceAsStream("/META-INF/" + file);
 
      if (is == null) {
        is = getClass().getResourceAsStream("/" + file);
      } 
 
      if (is != null) {
        return new InputSource(is);