Here you can find the source of getClassPathFromString(String classpath)
public static HashSet<URL> getClassPathFromString(String classpath)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.util.HashSet; import java.util.StringTokenizer; public class Main { public static HashSet<URL> getClassPathFromString(String classpath) { HashSet<URL> cpurls = new HashSet<URL>(); // Create a set of classpath URLs to be used later StringTokenizer st = new StringTokenizer(classpath, File.pathSeparator); while (st.hasMoreTokens()) { try { cpurls.add(new File(st.nextToken()).toURI().toURL()); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace();//from w ww . j av a 2 s .c om System.exit(-1); } } return cpurls; } }