1 package nmp.file_utils; 2 3 import java.io.*; 4 import java.lang.reflect.*; 5 6 7 public class LogExecute 8 { 9 public static void main( String[] args) { 10 try { 11 String[] newargs = new String[args.length - 3]; 12 for( int i = 3; i < args.length; i++) 13 newargs[i-3] = args[i]; 14 System.setOut( new PrintStream( new FileOutputStream( args[0]))); 15 System.setErr( new PrintStream( new FileOutputStream( args[1]))); 16 Class cl = Class.forName( args[2]); 17 Class[] argsT = { args.getClass()}; 18 Method met = cl.getMethod( "main", argsT); 19 Object[] objs = { newargs}; 20 met.invoke( null, objs); 21 } catch( Throwable th) { 22 th.printStackTrace(); 23 } 24 } 25 }

This page was automatically generated by Maven