code: public static DirectoryClassLoader getInstance(final File dir)
              throws GuacamoleException {
  
          try {
              // Attempt to create singleton classloader which loads classes from
              // all .jar's in the lib directory defined in guacamole.properties
              return AccessController.doPrivileged(new PrivilegedExceptionAction<DirectoryClassLoader>() {
  
                  @Override
                  public DirectoryClassLoader run() throws GuacamoleException {
                      return new DirectoryClassLoader(dir);
                  }
  
              });
          }
  
          catch (PrivilegedActionException e) {
              throw (GuacamoleException) e.getException();
          }
  
      }
docs: Returns an instance of DirectoryClassLoader configured to load .jar
  files from the given directory. Calling this function multiple times
  will not affect previously-returned instances of DirectoryClassLoader.
  
  @param dir
  The directory from which .jar files should be read.
  
  @return
  A DirectoryClassLoader instance which loads classes from the .jar
  files in the given directory.
  
  @throws GuacamoleException
  If the given file is not a directory, or the contents of the given
  directory cannot be read.