start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
/**
   * Populate the list of URLs with the items in the classpath string
   */
Populate the list of URLs with the items in the classpath string
Populate the list of URLs with the items in the classpath string
private static void addUrl(String classpath, ArrayList<URL> urls) throws MalformedURLException {
    classpath = classpath.trim();
    if (classpath.length() == 0)
      return;
    classpath = replaceEnvVars(classpath, System.getenv());
    URI uri = null;
    try {
      uri = new URI(classpath);
    } catch (URISyntaxException e) {
    }
    if (null == uri || !uri.isAbsolute()
        || (null != uri.getScheme() && uri.getScheme().equals("file://"))) {
      final File extDir = new File(classpath);
      if (extDir.isDirectory())
        urls.add(extDir.toURI().toURL());
      else {
        if (extDir.getParentFile() != null) {
          File[] extJars = extDir.getParentFile()
              .listFiles((dir, name) -> name.matches("^" + extDir.getName()));
          if (extJars != null && extJars.length > 0) {
            for (File jar : extJars)
              urls.add(jar.toURI().toURL());
          } else {
            log.debug("ignoring classpath entry {}", classpath);
          }
        } else {
          log.debug("ignoring classpath entry {}", classpath);
        }
      }
    } else {
      urls.add(uri.toURL());
    }
  }
private static void addUrl ( String classpath , ArrayList < URL > urls ) throws MalformedURLException { classpath = classpath . trim ( ) ; if ( classpath . length ( ) == 0 ) return ; classpath = replaceEnvVars ( classpath , System . getenv ( ) ) ; URI uri = null ; try { uri = new URI ( classpath ) ; } catch ( URISyntaxException e ) { } if ( null == uri || ! uri . isAbsolute ( ) || ( null != uri . getScheme ( ) && uri . getScheme ( ) . equals ( "file://" ) ) ) { final File extDir = new File ( classpath ) ; if ( extDir . isDirectory ( ) ) urls . add ( extDir . toURI ( ) . toURL ( ) ) ; else { if ( extDir . getParentFile ( ) != null ) { File [ ] extJars = extDir . getParentFile ( ) . listFiles ( ( dir , name ) -> name . matches ( "^" + extDir . getName ( ) ) ) ; if ( extJars != null && extJars . length > 0 ) { for ( File jar : extJars ) urls . add ( jar . toURI ( ) . toURL ( ) ) ; } else { log . debug ( "ignoring classpath entry {}" , classpath ) ; } } else { log . debug ( "ignoring classpath entry {}" , classpath ) ; } } } else { urls . add ( uri . toURL ( ) ) ; } }
Populate the list of URLs with the items in the classpath string
Populate the list of URLs with the items in the classpath string
// Try to make a URI out of the classpath // Not a valid URI // Then treat this URI as a File. // This checks to see if the url string is a dir if it expand and get all jars in that // directory