continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r648917 - /continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java
Date Thu, 17 Apr 2008 01:59:24 GMT
Author: carlos
Date: Wed Apr 16 18:58:58 2008
New Revision: 648917

URL: http://svn.apache.org/viewvc?rev=648917&view=rev
Log:
Refactor the command line creation

Modified:
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java?rev=648917&r1=648916&r2=648917&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java
Wed Apr 16 18:58:58 2008
@@ -60,14 +60,21 @@
                                     environments );
     }
 
-    public ExecutionResult executeShellCommand( File workingDirectory, String executable,
String[] arguments,
-                                                File output, long idCommand, Map<String,
String> environments )
+    /**
+     * Make the command line
+     * 
+     * @param workingDirectory
+     * @param executable
+     * @param arguments
+     * @param idCommand
+     * @param environments
+     * @return
+     * @throws Exception
+     */
+    protected Commandline createCommandline( File workingDirectory, String executable, String[]
arguments,
+                                             long idCommand, Map<String, String> environments
)
         throws Exception
     {
-        // ----------------------------------------------------------------------
-        // Make the command line
-        // ----------------------------------------------------------------------
-
         Commandline cl = new Commandline();
 
         cl.setPid( idCommand );
@@ -96,6 +103,16 @@
 
             cl.createArgument().setValue( argument );
         }
+
+        return cl;
+    }
+
+    public ExecutionResult executeShellCommand( File workingDirectory, String executable,
String[] arguments,
+                                                File output, long idCommand, Map<String,
String> environments )
+        throws Exception
+    {
+
+        Commandline cl = createCommandline( workingDirectory, executable, arguments, idCommand,
environments );
 
         getLogger().info( "Executing: " + cl );
         getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath()
);



Mime
View raw message