private ClassLoader getArchiveClassLoader(ViewConfig viewConfig, File archiveDir, List<File> viewsAdditionalClasspath)
      throws IOException {

    String    archivePath = archiveDir.getAbsolutePath();
    List<URL> urlList     = new LinkedList<>();

    // include the classes directory
    String classesPath = archivePath + File.separator + ARCHIVE_CLASSES_DIR;
    File   classesDir  = archiveUtility.getFile(classesPath);
    if (classesDir.exists()) {
      urlList.add(classesDir.toURI().toURL());
    }

        // include libs in additional classpath
    for (File file : viewsAdditionalClasspath) {
      if (file.isDirectory()) {
        // add all files inside this dir.
        addDirToClasspath(urlList, file);
      } else if (file.isFile()) {
        urlList.add(file.toURI().toURL());
      }
    }

    // include any libraries in the lib directory
    String libPath = archivePath + File.separator + ARCHIVE_LIB_DIR;
    File libDir = archiveUtility.getFile(libPath);
    addDirToClasspath(urlList, libDir);

    // include the archive directory
    urlList.add(archiveDir.toURI().toURL());

    LOG.trace("classpath for view {} is : {}", viewConfig.getName(), urlList);
    return new ViewClassLoader(viewConfig, urlList.toArray(new URL[urlList.size()]));
  }
Ensure that the extracted view archive directory exists.

@param extractedArchivesPath  the path

@return false if the directory does not exist and can not be created
ambari-server/src/main/java/org/apache/ambari/server/view/ViewExtractor.java