geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r721148 - in /geronimo/gshell/trunk: gshell-commands/gshell-optional/ gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ gshell-commands/gshell-optional/src/main/resources/META-INF/gshell/ gshell-com...
Date Thu, 27 Nov 2008 10:30:26 GMT
Author: jdillon
Date: Thu Nov 27 02:30:25 2008
New Revision: 721148

URL: http://svn.apache.org/viewvc?rev=721148&view=rev
Log:
Move some commands from gshell-vfs to gshell-optional

Added:
    geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatAction.java
  (contents, props changed)
      - copied, changed from r721125, geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CatAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EditAction.java
  (contents, props changed)
      - copied, changed from r721125, geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/EditAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/FindAction.java
  (contents, props changed)
      - copied, changed from r721125, geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/FindAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/GrepAction.java
  (contents, props changed)
      - copied, changed from r721125, geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/GrepAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/TouchAction.java
  (contents, props changed)
      - copied, changed from r721125, geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/TouchAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/CatAction.properties
  (props changed)
      - copied unchanged from r721125, geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/org/apache/geronimo/gshell/commands/vfs/CatAction.properties
    geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/EditAction.properties
  (props changed)
      - copied unchanged from r721125, geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/org/apache/geronimo/gshell/commands/vfs/EditAction.properties
    geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/FindAction.properties
  (props changed)
      - copied unchanged from r721125, geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/org/apache/geronimo/gshell/commands/vfs/FindAction.properties
    geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/GrepAction.properties
  (props changed)
      - copied unchanged from r721125, geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/org/apache/geronimo/gshell/commands/vfs/GrepAction.properties
    geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/TouchAction.properties
  (props changed)
      - copied unchanged from r721125, geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/org/apache/geronimo/gshell/commands/vfs/TouchAction.properties
    geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/support/
    geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/support/VfsActionSupport.java
  (with props)
Removed:
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CatAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/EditAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/FindAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/GrepAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/TouchAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/VfsActionSupport.java
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/org/apache/geronimo/gshell/commands/vfs/CatAction.properties
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/org/apache/geronimo/gshell/commands/vfs/EditAction.properties
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/org/apache/geronimo/gshell/commands/vfs/FindAction.properties
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/org/apache/geronimo/gshell/commands/vfs/GrepAction.properties
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/org/apache/geronimo/gshell/commands/vfs/TouchAction.properties
Modified:
    geronimo/gshell/trunk/gshell-commands/gshell-optional/pom.xml
    geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/META-INF/gshell/components.xml
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/ChangeDirectoryAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CopyAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CurrentDirectoryAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/FileInfoAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/ListDirectoryAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/RemoveAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/META-INF/gshell/components.xml

Modified: geronimo/gshell/trunk/gshell-commands/gshell-optional/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-optional/pom.xml?rev=721148&r1=721147&r2=721148&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-optional/pom.xml (original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-optional/pom.xml Thu Nov 27 02:30:25 2008
@@ -36,5 +36,12 @@
     <description>
         Provides some optional commands.
     </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.gshell.support</groupId>
+            <artifactId>gshell-vfs</artifactId>
+        </dependency>
+    </dependencies>
     
 </project>
\ No newline at end of file

Copied: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatAction.java
(from r721125, geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CatAction.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatAction.java?p2=geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatAction.java&p1=geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CatAction.java&r1=721125&r2=721148&rev=721148&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CatAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatAction.java
Thu Nov 27 02:30:25 2008
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.commands.vfs;
+package org.apache.geronimo.gshell.commands.optional;
 
 import org.apache.commons.vfs.FileContent;
 import org.apache.commons.vfs.FileContentInfo;
@@ -25,9 +25,11 @@
 import org.apache.geronimo.gshell.clp.Argument;
 import org.apache.geronimo.gshell.clp.Option;
 import org.apache.geronimo.gshell.command.CommandContext;
+import org.apache.geronimo.gshell.command.CommandAction;
 import org.apache.geronimo.gshell.io.Closer;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.vfs.FileObjects;
+import org.apache.geronimo.gshell.vfs.support.VfsActionSupport;
 
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -81,7 +83,7 @@
 
         FileObjects.close(file);
         
-        return Result.SUCCESS;
+        return CommandAction.Result.SUCCESS;
     }
 
     private void cat(final BufferedReader reader, final IO io) throws IOException {

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatAction.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/CatAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EditAction.java
(from r721125, geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/EditAction.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EditAction.java?p2=geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EditAction.java&p1=geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/EditAction.java&r1=721125&r2=721148&rev=721148&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/EditAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EditAction.java
Thu Nov 27 02:30:25 2008
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.commands.vfs;
+package org.apache.geronimo.gshell.commands.optional;
 
 import org.apache.commons.vfs.FileObject;
 import org.apache.commons.vfs.Selectors;
@@ -26,6 +26,7 @@
 import org.apache.geronimo.gshell.clp.Option;
 import org.apache.geronimo.gshell.command.CommandContext;
 import org.apache.geronimo.gshell.vfs.FileObjects;
+import org.apache.geronimo.gshell.vfs.support.VfsActionSupport;
 
 import java.io.File;
 import java.util.Arrays;

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EditAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EditAction.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EditAction.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/EditAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/FindAction.java
(from r721125, geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/FindAction.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/FindAction.java?p2=geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/FindAction.java&p1=geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/FindAction.java&r1=721125&r2=721148&rev=721148&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/FindAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/FindAction.java
Thu Nov 27 02:30:25 2008
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.commands.vfs;
+package org.apache.geronimo.gshell.commands.optional;
 
 import org.apache.commons.vfs.FileObject;
 import org.apache.commons.vfs.FileSelectInfo;
@@ -27,8 +27,10 @@
 import org.apache.geronimo.gshell.clp.Argument;
 import org.apache.geronimo.gshell.clp.Option;
 import org.apache.geronimo.gshell.command.CommandContext;
+import org.apache.geronimo.gshell.command.CommandAction;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.vfs.FileObjects;
+import org.apache.geronimo.gshell.vfs.support.VfsActionSupport;
 import org.apache.geronimo.gshell.vfs.selector.AggregateFileSelector;
 import org.apache.oro.text.GlobCompiler;
 import org.apache.oro.text.regex.MalformedPatternException;
@@ -80,7 +82,7 @@
 
         FileObjects.close(root);
         
-        return Result.SUCCESS;
+        return CommandAction.Result.SUCCESS;
     }
 
     private void find(final CommandContext context, final FileObject file, final FileSelector
selector) throws FileSystemException {

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/FindAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/FindAction.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/FindAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/GrepAction.java
(from r721125, geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/GrepAction.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/GrepAction.java?p2=geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/GrepAction.java&p1=geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/GrepAction.java&r1=721125&r2=721148&rev=721148&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/GrepAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/GrepAction.java
Thu Nov 27 02:30:25 2008
@@ -17,15 +17,17 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.commands.vfs;
+package org.apache.geronimo.gshell.commands.optional;
 
 import org.apache.commons.vfs.FileObject;
 import org.apache.geronimo.gshell.clp.Argument;
 import org.apache.geronimo.gshell.clp.Option;
 import org.apache.geronimo.gshell.command.CommandContext;
+import org.apache.geronimo.gshell.command.CommandAction;
 import org.apache.geronimo.gshell.io.Closer;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.vfs.FileObjects;
+import org.apache.geronimo.gshell.vfs.support.VfsActionSupport;
 import org.apache.oro.text.MatchAction;
 import org.apache.oro.text.MatchActionInfo;
 import org.apache.oro.text.MatchActionProcessor;
@@ -116,7 +118,7 @@
         }
         catch (MalformedPatternException e) {
             io.error("Invalid pattern: " + e, e);
-            return Result.FAILURE;
+            return CommandAction.Result.FAILURE;
         }
 
         if (path != null) {

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/GrepAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/GrepAction.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/GrepAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/TouchAction.java
(from r721125, geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/TouchAction.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/TouchAction.java?p2=geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/TouchAction.java&p1=geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/TouchAction.java&r1=721125&r2=721148&rev=721148&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/TouchAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/TouchAction.java
Thu Nov 27 02:30:25 2008
@@ -17,12 +17,14 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.commands.vfs;
+package org.apache.geronimo.gshell.commands.optional;
 
 import org.apache.commons.vfs.FileObject;
 import org.apache.geronimo.gshell.clp.Argument;
 import org.apache.geronimo.gshell.command.CommandContext;
+import org.apache.geronimo.gshell.command.CommandAction;
 import org.apache.geronimo.gshell.vfs.FileObjects;
+import org.apache.geronimo.gshell.vfs.support.VfsActionSupport;
 
 /**
  * Sets the last-modified time of a file.
@@ -53,6 +55,6 @@
             FileObjects.close(file);
         }
 
-        return Result.SUCCESS;
+        return CommandAction.Result.SUCCESS;
     }
 }
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/TouchAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/TouchAction.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/TouchAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/META-INF/gshell/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/META-INF/gshell/components.xml?rev=721148&r1=721147&r2=721148&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/META-INF/gshell/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/META-INF/gshell/components.xml
Thu Nov 27 02:30:25 2008
@@ -52,6 +52,42 @@
             <gshell:command name="hostname">
                 <gshell:action class="org.apache.geronimo.gshell.commands.optional.HostnameAction"/>
             </gshell:command>
+
+            <gshell:command name="cat">
+                <gshell:action class="org.apache.geronimo.gshell.commands.optional.CatAction"
parent="vfsCommandActionTemplate"/>
+                <gshell:completers>
+                    <ref bean="fileObjectNameCompleter"/>
+                    <null/>
+                </gshell:completers>
+            </gshell:command>
+
+            <gshell:command name="edit">
+                <gshell:action class="org.apache.geronimo.gshell.commands.optional.EditAction"
parent="vfsCommandActionTemplate"/>
+                <gshell:completers>
+                    <ref bean="fileObjectNameCompleter"/>
+                    <null/>
+                </gshell:completers>
+            </gshell:command>
+
+            <gshell:command name="touch">
+                <gshell:action class="org.apache.geronimo.gshell.commands.optional.TouchAction"
parent="vfsCommandActionTemplate"/>
+                <gshell:completers>
+                    <ref bean="fileObjectNameCompleter"/>
+                    <null/>
+                </gshell:completers>
+            </gshell:command>
+
+            <gshell:command name="find">
+                <gshell:action class="org.apache.geronimo.gshell.commands.optional.FindAction"
parent="vfsCommandActionTemplate"/>
+                <gshell:completers>
+                    <ref bean="fileObjectNameCompleter"/>
+                    <null/>
+                </gshell:completers>
+            </gshell:command>
+
+            <gshell:command name="grep">
+                <gshell:action class="org.apache.geronimo.gshell.commands.optional.GrepAction"
parent="vfsCommandActionTemplate"/>
+            </gshell:command>
         </gshell:command-bundle>
     </gshell:plugin>
 

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/CatAction.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/CatAction.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/CatAction.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/EditAction.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/EditAction.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/EditAction.properties
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/EditAction.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/FindAction.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/FindAction.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/FindAction.properties
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/FindAction.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/GrepAction.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/GrepAction.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/GrepAction.properties
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/GrepAction.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/TouchAction.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/TouchAction.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/resources/org/apache/geronimo/gshell/commands/optional/TouchAction.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/ChangeDirectoryAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/ChangeDirectoryAction.java?rev=721148&r1=721147&r2=721148&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/ChangeDirectoryAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/ChangeDirectoryAction.java
Thu Nov 27 02:30:25 2008
@@ -24,6 +24,7 @@
 import org.apache.geronimo.gshell.command.CommandContext;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.vfs.FileObjects;
+import org.apache.geronimo.gshell.vfs.support.VfsActionSupport;
 
 /**
  * Changes the current directory.

Modified: geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CopyAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CopyAction.java?rev=721148&r1=721147&r2=721148&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CopyAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CopyAction.java
Thu Nov 27 02:30:25 2008
@@ -25,6 +25,7 @@
 import org.apache.geronimo.gshell.command.CommandContext;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.vfs.FileObjects;
+import org.apache.geronimo.gshell.vfs.support.VfsActionSupport;
 
 /**
  * Copies a file or directory.

Modified: geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CurrentDirectoryAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CurrentDirectoryAction.java?rev=721148&r1=721147&r2=721148&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CurrentDirectoryAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/CurrentDirectoryAction.java
Thu Nov 27 02:30:25 2008
@@ -23,6 +23,7 @@
 import org.apache.geronimo.gshell.command.CommandContext;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.vfs.FileObjects;
+import org.apache.geronimo.gshell.vfs.support.VfsActionSupport;
 
 /**
  * Displays the current directory.

Modified: geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/FileInfoAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/FileInfoAction.java?rev=721148&r1=721147&r2=721148&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/FileInfoAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/FileInfoAction.java
Thu Nov 27 02:30:25 2008
@@ -28,6 +28,7 @@
 import org.apache.geronimo.gshell.command.CommandContext;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.vfs.FileObjects;
+import org.apache.geronimo.gshell.vfs.support.VfsActionSupport;
 
 import java.security.cert.Certificate;
 import java.text.DateFormat;

Modified: geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/ListDirectoryAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/ListDirectoryAction.java?rev=721148&r1=721147&r2=721148&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/ListDirectoryAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/ListDirectoryAction.java
Thu Nov 27 02:30:25 2008
@@ -31,6 +31,7 @@
 import org.apache.geronimo.gshell.command.CommandContext;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.vfs.FileObjects;
+import org.apache.geronimo.gshell.vfs.support.VfsActionSupport;
 
 import java.util.ArrayList;
 import java.util.LinkedList;

Modified: geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/RemoveAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/RemoveAction.java?rev=721148&r1=721147&r2=721148&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/RemoveAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/java/org/apache/geronimo/gshell/commands/vfs/RemoveAction.java
Thu Nov 27 02:30:25 2008
@@ -25,6 +25,7 @@
 import org.apache.geronimo.gshell.command.CommandContext;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.vfs.FileObjects;
+import org.apache.geronimo.gshell.vfs.support.VfsActionSupport;
 
 /**
  * Remove a file or directory.

Modified: geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/META-INF/gshell/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/META-INF/gshell/components.xml?rev=721148&r1=721147&r2=721148&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/META-INF/gshell/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-vfs/src/main/resources/META-INF/gshell/components.xml
Thu Nov 27 02:30:25 2008
@@ -80,30 +80,6 @@
 
             <gshell:link name="del" target="rm"/>
 
-            <gshell:command name="cat">
-                <gshell:action class="org.apache.geronimo.gshell.commands.vfs.CatAction"
parent="vfsCommandActionTemplate"/>
-                <gshell:completers>
-                    <ref bean="fileObjectNameCompleter"/>
-                    <null/>
-                </gshell:completers>
-            </gshell:command>
-
-            <gshell:command name="edit">
-                <gshell:action class="org.apache.geronimo.gshell.commands.vfs.EditAction"
parent="vfsCommandActionTemplate"/>
-                <gshell:completers>
-                    <ref bean="fileObjectNameCompleter"/>
-                    <null/>
-                </gshell:completers>
-            </gshell:command>
-
-            <gshell:command name="touch">
-                <gshell:action class="org.apache.geronimo.gshell.commands.vfs.TouchAction"
parent="vfsCommandActionTemplate"/>
-                <gshell:completers>
-                    <ref bean="fileObjectNameCompleter"/>
-                    <null/>
-                </gshell:completers>
-            </gshell:command>
-
             <gshell:command name="fileinfo">
                 <gshell:action class="org.apache.geronimo.gshell.commands.vfs.FileInfoAction"
parent="vfsCommandActionTemplate"/>
                 <gshell:completers>
@@ -111,18 +87,6 @@
                     <null/>
                 </gshell:completers>
             </gshell:command>
-
-            <gshell:command name="find">
-                <gshell:action class="org.apache.geronimo.gshell.commands.vfs.FindAction"
parent="vfsCommandActionTemplate"/>
-                <gshell:completers>
-                    <ref bean="fileObjectNameCompleter"/>
-                    <null/>
-                </gshell:completers>
-            </gshell:command>
-
-            <gshell:command name="grep">
-                <gshell:action class="org.apache.geronimo.gshell.commands.vfs.GrepAction"
parent="vfsCommandActionTemplate"/>
-            </gshell:command>
         </gshell:command-bundle>
     </gshell:plugin>
 

Added: geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/support/VfsActionSupport.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/support/VfsActionSupport.java?rev=721148&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/support/VfsActionSupport.java
(added)
+++ geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/support/VfsActionSupport.java
Thu Nov 27 02:30:25 2008
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.vfs.support;
+
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystemException;
+import org.apache.geronimo.gshell.command.CommandAction;
+import org.apache.geronimo.gshell.command.CommandContext;
+import org.apache.geronimo.gshell.vfs.FileObjects;
+import org.apache.geronimo.gshell.vfs.FileSystemAccess;
+import org.apache.geronimo.gshell.notification.ResultNotification;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Required;
+
+/**
+ * Support for VFS command actions.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class VfsActionSupport
+    implements CommandAction
+{
+    protected final Logger log = LoggerFactory.getLogger(getClass());
+
+    private FileSystemAccess fileSystemAccess;
+
+    @Required
+    public void setFileSystemAccess(final FileSystemAccess fileSystemAccess) {
+        assert fileSystemAccess != null;
+        this.fileSystemAccess = fileSystemAccess;
+    }
+
+    protected FileSystemAccess getFileSystemAccess() {
+        assert fileSystemAccess != null;
+        return fileSystemAccess;
+    }
+
+    protected FileObject getCurrentDirectory(final CommandContext context) throws FileSystemException
{
+        assert context != null;
+
+        return getFileSystemAccess().getCurrentDirectory(context.getVariables());
+    }
+
+    protected void setCurrentDirectory(final CommandContext context, final FileObject dir)
throws FileSystemException {
+        assert context != null;
+
+        getFileSystemAccess().setCurrentDirectory(context.getVariables(), dir);
+    }
+
+    protected FileObject resolveFile(final CommandContext context, final String path) throws
FileSystemException {
+        assert context != null;
+        assert path != null;
+
+        log.trace("Resolving path: {}", path);
+
+        FileObject cwd = getCurrentDirectory(context);
+        return getFileSystemAccess().resolveFile(cwd, path);
+    }
+
+    //
+    // TODO: Make these more generally available to other plugins.  Maybe even to FileObjects?
+    //
+
+    protected void ensureFileExists(final FileObject file) throws FileSystemException {
+        assert file != null;
+
+        if (!file.exists()) {
+            FileObjects.close(file);
+            throw new ResultNotification("File not found: " + file.getName(), Result.FAILURE);
+        }
+    }
+
+    protected void ensureFileHasContent(final FileObject file) throws FileSystemException
{
+        assert file != null;
+
+        if (!file.getType().hasContent()) {
+            FileObjects.close(file);
+            throw new ResultNotification("File has no content: " + file.getName(), Result.FAILURE);
+        }
+    }
+
+    protected void ensureFileHasChildren(final FileObject file) throws FileSystemException
{
+        assert file != null;
+
+        if (!file.getType().hasChildren()) {
+            FileObjects.close(file);
+            throw new ResultNotification("File has no children: " + file.getName(), Result.FAILURE);
+        }
+    }
+
+    protected void ensureFileIsReadable(final FileObject file) throws FileSystemException
{
+        assert file != null;
+
+        if (!file.getType().hasChildren()) {
+            FileObjects.close(file);
+            throw new ResultNotification("File is not readable: " + file.getName(), Result.FAILURE);
+        }
+    }
+
+    protected void ensureFileIsWritable(final FileObject file) throws FileSystemException
{
+        assert file != null;
+
+        if (!file.getType().hasChildren()) {
+            FileObjects.close(file);
+            throw new ResultNotification("File is not writable: " + file.getName(), Result.FAILURE);
+        }
+    }
+}
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/support/VfsActionSupport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/support/VfsActionSupport.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/support/VfsActionSupport.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message