code: protected URL[] getUrls(File directory) throws MalformedURLException, IOException
     {
        List<URL> list = new LinkedList<URL>();
  
        if (directory.exists() && directory.isDirectory())
        {
           // Add directory
           list.add(directory.toURI().toURL());
  
           // Add the contents of the directory too
           File[] jars = directory.listFiles(new JarFilter());
  
           if (jars != null)
           {
              for (int j = 0; j < jars.length; j++)
              {
                 list.add(jars[j].getCanonicalFile().toURI().toURL());
              }
           }
        }
        return list.toArray(new URL[list.size()]);
     }
docs: Get the URLs for the directory and all libraries located in the directory
  @param directory The directory
  @return The URLs
  @exception MalformedURLException MalformedURLException
  @exception IOException IOException