FileDocCategorySizeDatePackage
Classpath.javaAPI DocGlassfish v2 API3738Fri May 04 22:32:14 BST 2007com.sun.enterprise.util.diagnostics

Classpath

public class Classpath extends Object
author
bnevins
version

Fields Summary
Constructors Summary
Methods Summary
public static java.util.ListgetClasspathAsBatchCommands()

		List from = getClasspathAsList();
		List to	= new ArrayList();
		
		boolean first = true;
		
		for(Iterator iter = from.iterator(); iter.hasNext(); )
		{
			if(first)
			{
				to.add("set CLASSPATH=" + iter.next());
				first = false;
			}
			else
				to.add("set CLASSPATH=%CLASSPATH%;" + iter.next());
		}
		
		return to;
	
public static java.util.ListgetClasspathAsList()

		String			cp		= getClasspathAsString();
		String			ps		= System.getProperty("path.separator");
		StringTokenizer st		= new StringTokenizer(cp, ps);
		List			list	= new ArrayList();
		
		while (st.hasMoreTokens()) 
		{
			list.add(st.nextToken());
		}
		
		return list;
	
public static java.util.ListgetClasspathAsSortedList()

		List list = getClasspathAsList();
		Collections.sort(list, String.CASE_INSENSITIVE_ORDER);
		return list;
	
public static java.lang.StringgetClasspathAsString()

		return System.getProperty("java.class.path");
	
public static voidmain(java.lang.String[] args)

		pr("******  CLASSPATH as String *******");
		pr(getClasspathAsString());
		pr("******  CLASSPATH as List *******");
		pr(getClasspathAsList());
		pr("******  CLASSPATH as Sorted List *******");
		pr(getClasspathAsSortedList());
		pr("******  CLASSPATH as Batch Commands *******");
		pr(getClasspathAsBatchCommands());
	
private static voidpr(java.lang.String s)

		System.out.println(s);
	
private static voidpr(java.util.List c)

		for(Iterator iter = c.iterator(); iter.hasNext(); )
		{
			pr((String)iter.next());
		}