Here you can find the source of getClassLoader(String path)
public static ClassLoader getClassLoader(String path)
//package com.java2s; import java.io.File; import java.net.URL; import java.net.URLClassLoader; public class Main { public static ClassLoader getClassLoader(String path) { try {/* w w w .j a v a 2s . c o m*/ File file = new File(path); URL url = file.toURL(); return new URLClassLoader(new URL[] { url }, Thread.currentThread().getContextClassLoader()); } catch (Exception e) { return Thread.currentThread().getContextClassLoader(); } } }