private synchronized void initTempDir(final Configuration conf) {
    jarModifiedTime = new HashMap<>();
    String localDirPath = conf.get(LOCAL_DIR_KEY, DEFAULT_LOCAL_DIR) + DYNAMIC_JARS_DIR;
    localDir = new File(localDirPath);
    if (!localDir.mkdirs() && !localDir.isDirectory()) {
      throw new RuntimeException(
        "Failed to create local dir " + localDir.getPath() + ", DynamicClassLoader failed to init");
    }

    String remotePath = conf.get(DYNAMIC_JARS_DIR_KEY);
    if (remotePath == null || remotePath.equals(localDirPath)) {
      remoteDir = null; // ignore if it is the same as the local path
    } else {
      remoteDir = new Path(remotePath);
      try {
        remoteDirFs = remoteDir.getFileSystem(conf);
      } catch (IOException ioe) {
        LOG.warn("Failed to identify the fs of dir " + remoteDir + ", ignored", ioe);
        remoteDir = null;
      }
    }
  }
Creates a DynamicClassLoader that can load classes dynamically from jar files under a specific
folder.
@param conf   the configuration for the cluster.
@param parent the parent ClassLoader to set.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/DynamicClassLoader.java