jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edgarp...@apache.org
Subject svn commit: r312959 - in /incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command: cli/JcrClient.java info/AbstractLsProperties.java
Date Tue, 11 Oct 2005 21:24:12 GMT
Author: edgarpoce
Date: Tue Oct 11 14:23:58 2005
New Revision: 312959

URL: http://svn.apache.org/viewcvs?rev=312959&view=rev
Log:
cd root if the current working node becomes invalid

Modified:
    incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/JcrClient.java
    incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/info/AbstractLsProperties.java

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/JcrClient.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/JcrClient.java?rev=312959&r1=312958&r2=312959&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/JcrClient.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/JcrClient.java
Tue Oct 11 14:23:58 2005
@@ -23,6 +23,7 @@
 import java.util.Locale;
 import java.util.ResourceBundle;
 
+import javax.jcr.InvalidItemStateException;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 
@@ -256,7 +257,14 @@
 
         try {
             Node n = CommandHelper.getCurrentNode(ctx);
-            return n.getPath();
+            // the current node might be Invalid
+            try {
+                return n.getPath();
+            } catch (InvalidItemStateException e) {
+                CommandHelper.setCurrentNode(ctx, CommandHelper.getSession(ctx)
+                    .getRootNode());
+                return CommandHelper.getCurrentNode(ctx).getPath();
+            }
         } catch (CommandException e) {
             return bundle.getString("phrase.not.logged.in");
         }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/info/AbstractLsProperties.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/info/AbstractLsProperties.java?rev=312959&r1=312958&r2=312959&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/info/AbstractLsProperties.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/info/AbstractLsProperties.java
Tue Oct 11 14:23:58 2005
@@ -38,12 +38,15 @@
     /** bundle */
     private static ResourceBundle bundle = CommandHelper.getBundle();
 
+    /** length of length field */
+    private static final int LENGTH_LENGTH = 8;
+
     /**
      * {@inheritDoc}
      */
     public final boolean execute(Context ctx) throws Exception {
         int[] width = new int[] {
-                30, longWidth, longWidth, longWidth, 20
+                30, longWidth, longWidth, LENGTH_LENGTH, 18
         };
 
         String header[] = new String[] {



Mime
View raw message