From 14da38e484007c2a5e2c0bc7c27ed0060c0642c1 Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Sun, 6 Jan 2002 01:51:46 +0000 Subject: [PATCH] Remove unused method git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270556 13f79535-47bb-0310-9956-ffa450edef68 --- .../tools/ant/taskdefs/exec/Execute.java | 35 ------------------- .../tools/ant/taskdefs/exec/Execute.java | 35 ------------------- 2 files changed, 70 deletions(-) diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/Execute.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/Execute.java index f930747ff..e4d4a0b60 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/Execute.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/Execute.java @@ -11,13 +11,10 @@ import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.util.Properties; -import org.apache.avalon.framework.logger.Logger; import org.apache.myrmidon.api.TaskException; import org.apache.myrmidon.framework.exec.ExecException; import org.apache.myrmidon.framework.exec.ExecMetaData; import org.apache.myrmidon.framework.exec.impl.DefaultExecManager; -import org.apache.tools.ant.Task; -import org.apache.tools.ant.types.Commandline; /** * Runs an external program. @@ -52,38 +49,6 @@ public class Execute return new File( antHome ); } - /** - * A utility method that runs an external command. Writes the output and - * error streams of the command to the project log. - * - * @param task The task that the command is part of. Used for logging - * @param cmdline The command to execute. - * @throws TaskException if the command does not return 0. - */ - public static void runCommand( final Task task, final String[] cmdline ) - throws TaskException - { - try - { - final Logger logger = task.hackGetLogger(); - logger.debug( Commandline.toString( cmdline ) ); - final Execute exe = new Execute(); - exe.setOutput( new LogOutputStream( logger, false ) ); - exe.setError( new LogOutputStream( logger, true ) ); - - exe.setCommandline( cmdline ); - int retval = exe.execute(); - if( retval != 0 ) - { - throw new TaskException( cmdline[ 0 ] + " failed with return code " + retval ); - } - } - catch( final IOException ioe ) - { - throw new TaskException( "Could not launch " + cmdline[ 0 ] + ": " + ioe ); - } - } - /** * Creates a new execute object. * diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/exec/Execute.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/exec/Execute.java index f930747ff..e4d4a0b60 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/exec/Execute.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/exec/Execute.java @@ -11,13 +11,10 @@ import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.util.Properties; -import org.apache.avalon.framework.logger.Logger; import org.apache.myrmidon.api.TaskException; import org.apache.myrmidon.framework.exec.ExecException; import org.apache.myrmidon.framework.exec.ExecMetaData; import org.apache.myrmidon.framework.exec.impl.DefaultExecManager; -import org.apache.tools.ant.Task; -import org.apache.tools.ant.types.Commandline; /** * Runs an external program. @@ -52,38 +49,6 @@ public class Execute return new File( antHome ); } - /** - * A utility method that runs an external command. Writes the output and - * error streams of the command to the project log. - * - * @param task The task that the command is part of. Used for logging - * @param cmdline The command to execute. - * @throws TaskException if the command does not return 0. - */ - public static void runCommand( final Task task, final String[] cmdline ) - throws TaskException - { - try - { - final Logger logger = task.hackGetLogger(); - logger.debug( Commandline.toString( cmdline ) ); - final Execute exe = new Execute(); - exe.setOutput( new LogOutputStream( logger, false ) ); - exe.setError( new LogOutputStream( logger, true ) ); - - exe.setCommandline( cmdline ); - int retval = exe.execute(); - if( retval != 0 ) - { - throw new TaskException( cmdline[ 0 ] + " failed with return code " + retval ); - } - } - catch( final IOException ioe ) - { - throw new TaskException( "Could not launch " + cmdline[ 0 ] + ": " + ioe ); - } - } - /** * Creates a new execute object. *