InputStream locateScriptFile(String path,String pkg,String name) throws FileNotFoundException {
  if (m_sourceLocator != null) {
    m_sourceLocatorChangeCount=m_sourceLocator.getChangeCount();
    InputStream is=m_sourceLocator.locateSource(path,pkg,name);
    if (is != null)     return is;
  }
  path=path.replace('/',File.separatorChar);
  pkg=pkg.replace('/',File.separatorChar);
  File f;
  if (path.length() > 0) {
    try {
      String pkgAndName="";
      if (pkg.length() > 0)       pkgAndName+=pkg + File.separatorChar;
      pkgAndName+=name;
      f=new File(path,pkgAndName);
      if (f.exists())       return new FileInputStream(f);
    }
 catch (    NullPointerException npe) {
    }
  }
  if (pkg.length() > 0) {
    f=new File(pkg,name);
    if (f.exists())     return new FileInputStream(f);
  }
  f=new File(name);
  if (f.exists())   return new FileInputStream(f);
  return null;
}

InputStream locateScriptFile ( String path , String pkg , String name ) throws FileNotFoundException { if ( m_sourceLocator != null ) { m_sourceLocatorChangeCount = m_sourceLocator . getChangeCount ( ) ; InputStream is = m_sourceLocator . locateSource ( path , pkg , name ) ; if ( is != null ) return is ; } path = path . replace ( '/' , File . separatorChar ) ; pkg = pkg . replace ( '/' , File . separatorChar ) ; File f ; if ( path . length ( ) > 0 ) { try { String pkgAndName = "" ; if ( pkg . length ( ) > 0 ) pkgAndName += pkg + File . separatorChar ; pkgAndName += name ; f = new File ( path , pkgAndName ) ; if ( f . exists ( ) ) return new FileInputStream ( f ) ; } catch ( NullPointerException npe ) { } } if ( pkg . length ( ) > 0 ) { f = new File ( pkg , name ) ; if ( f . exists ( ) ) return new FileInputStream ( f ) ; } f = new File ( name ) ; if ( f . exists ( ) ) return new FileInputStream ( f ) ; return null ; }
logic to poke around on disk in order to find the given filename . we look under the mattress and all other possible places for the silly thing . we always try locating the file directly first , if that fails then we hunt out the swd .
