geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r417106 - /geronimo/sandbox/gshell/trunk/gshell-commands/gshell-standard-commands/src/main/java/org/apache/geronimo/gshell/commands/standard/CatCommand.java
Date Mon, 26 Jun 2006 01:57:10 GMT
Author: jdillon
Date: Sun Jun 25 18:57:09 2006
New Revision: 417106

URL: http://svn.apache.org/viewvc?rev=417106&view=rev
Log:
Condense

Modified:
    geronimo/sandbox/gshell/trunk/gshell-commands/gshell-standard-commands/src/main/java/org/apache/geronimo/gshell/commands/standard/CatCommand.java

Modified: geronimo/sandbox/gshell/trunk/gshell-commands/gshell-standard-commands/src/main/java/org/apache/geronimo/gshell/commands/standard/CatCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-commands/gshell-standard-commands/src/main/java/org/apache/geronimo/gshell/commands/standard/CatCommand.java?rev=417106&r1=417105&r2=417106&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-commands/gshell-standard-commands/src/main/java/org/apache/geronimo/gshell/commands/standard/CatCommand.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-commands/gshell-standard-commands/src/main/java/org/apache/geronimo/gshell/commands/standard/CatCommand.java
Sun Jun 25 18:57:09 2006
@@ -31,7 +31,6 @@
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileReader;
-import java.io.IOException;
 import java.io.InputStreamReader;
 import java.net.URL;
 import java.net.MalformedURLException;
@@ -78,21 +77,18 @@
         return usage;
     }
 
-    protected Object doExecute(Object[] args) throws Exception {
+    protected Object doExecute(final Object[] args) throws Exception {
         assert args != null;
 
+        String[] files;
+
         // No args, then read from STDIN
         if (args.length == 0) {
-            args = new String[] { "-" };
+            files = new String[] { "-" };
+        }
+        else {
+            files = Arguments.toStringArray(args);
         }
-
-        cat(Arguments.toStringArray(args));
-
-        return Command.SUCCESS;
-    }
-
-    private void cat(final String[] files) throws IOException {
-        assert files != null;
 
         IO io = getIO();
 
@@ -136,5 +132,7 @@
 
             reader.close();
         }
+
+        return Command.SUCCESS;
     }
 }



Mime
View raw message