src/main/java/org/jboss/util/xml/JBossEntityResolver.java
protected InputSource resolveClasspathName(String systemId, boolean trace)
   {
      if( systemId == null )
         return null;

      if( trace )
         log.trace("resolveClasspathName, systemId="+systemId);
      String filename = systemId;
      // Parse the systemId as a uri to get the final path component
      try
      {
         URI url = new URI(systemId);
         String path = url.getPath();
         if( path == null )
            path = url.getSchemeSpecificPart();
         int slash = path.lastIndexOf('/');
         if( slash >= 0 )
            filename = path.substring(slash + 1);
         else
            filename = path;

         if(filename.length() == 0)
            return null;

         if (trace)
            log.trace("Mapped systemId to filename: " + filename);
      }
      catch (URISyntaxException e)
      {
         if (trace)
            log.trace("systemId: is not a URI, using systemId as resource", e);
      }

      // Resolve the filename as a classpath resource
      InputStream is = loadClasspathResource(filename, trace);
      InputSource inputSource = null;
      if( is != null )
      {
         inputSource = new InputSource(is);
         inputSource.setSystemId(systemId);
      }
      return inputSource;
   }
protected InputSource resolveClasspathName(String systemId, boolean trace)
   {
      if( systemId == null )
         return null;

      if( trace )
         log.trace("resolveClasspathName, systemId="+systemId);
      String filename = systemId;
      // Parse the systemId as a uri to get the final path component
      try
      {
         URI url = new URI(systemId);
         String path = url.getPath();
         if( path == null )
            path = url.getSchemeSpecificPart();
         int slash = path.lastIndexOf('/');
         if( slash >= 0 )
            filename = path.substring(slash + 1);
         else
            filename = path;

         if(filename.length() == 0)
            return null;

         if (trace)
            log.trace("Mapped systemId to filename: " + filename);
      }
      catch (URISyntaxException e)
      {
         if (trace)
            log.trace("systemId: is not a URI, using systemId as resource", e);
      }

      // Resolve the filename as a classpath resource
      InputStream is = loadClasspathResource(filename, trace);
      InputSource inputSource = null;
      if( is != null )
      {
         inputSource = new InputSource(is);
         inputSource.setSystemId(systemId);
      }
      return inputSource;
   }
protected InputSource resolveClasspathName ( String systemId , boolean trace ) { if ( systemId == null ) return null ; if ( trace ) log . trace ( "resolveClasspathName, systemId=" + systemId ) ; String filename = systemId ; // Parse the systemId as a uri to get the final path component try { URI url = new URI ( systemId ) ; String path = url . getPath ( ) ; if ( path == null ) path = url . getSchemeSpecificPart ( ) ; int slash = path . lastIndexOf ( ' ' ) ; if ( slash >= 0 ) filename = path . substring ( slash + 1 ) ; else filename = path ; if ( filename . length ( ) == 0 ) return null ; if ( trace ) log . trace ( "Mapped systemId to filename: " + filename ) ; } catch ( URISyntaxException e ) { if ( trace ) log . trace ( "systemId: is not a URI, using systemId as resource" , e ) ; } // Resolve the filename as a classpath resource InputStream is = loadClasspathResource ( filename , trace ) ; InputSource inputSource = null ; if ( is != null ) { inputSource = new InputSource ( is ) ; inputSource . setSystemId ( systemId ) ; } return inputSource ; }
Resolve the systemId as a classpath resource. If not found, the
systemId is simply used as a classpath resource name.

@param systemId - the system ID of DTD or Schema
@param trace - trace level logging flag
@return the InputSource for the schema file found on the classpath, null
if the systemId is not registered or found.
Resolve the systemId as a classpath resource . If not found the systemId is simply used as a classpath resource name .