1 18 19 package com.martiansoftware.nailgun.examples; 20 21 import java.util.Iterator ; 22 import java.util.TreeSet ; 23 24 import com.martiansoftware.nailgun.NGContext; 25 26 31 public class DumpAll { 32 33 public static void nailMain(NGContext context) { 34 context.out.println(); 35 context.out.println(" context.getCommand(): " + context.getCommand()); 36 context.out.println(" context.getInetAddress(): " + context.getInetAddress()); 37 context.out.println(" context.getPort(): " + context.getPort()); 38 context.out.println("context.getWorkingDirectory(): " + context.getWorkingDirectory()); 39 context.out.println(" context.getFileSeparator(): " + context.getFileSeparator()); 40 context.out.println(" context.getPathSeparator(): " + context.getPathSeparator()); 41 42 context.out.println("\ncontext.getArgs():"); 43 for (int i = 0; i < context.getArgs().length; ++i) { 44 context.out.println(" args[" + i + "]=" + context.getArgs()[i]); 45 } 46 47 context.out.println("\ncontext.getEnv():"); 48 TreeSet keys = new TreeSet (context.getEnv().keySet()); 49 for (Iterator i = keys.iterator(); i.hasNext();) { 50 String key = (String ) i.next(); 51 context.out.println(" env[\"" + key + "\"]=" + context.getEnv().getProperty(key)); 52 } 53 } 54 } 55 | Popular Tags |