jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edgarp...@apache.org
Subject svn commit: r312896 [3/6] - in /incubator/jackrabbit/trunk/contrib/jcr-commands: ./ src/java/org/apache/jackrabbit/command/ src/java/org/apache/jackrabbit/command/cli/ src/java/org/apache/jackrabbit/command/collect/ src/java/org/apache/jackrabbit/comma...
Date Tue, 11 Oct 2005 14:41:03 GMT
Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Clone.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Clone.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Clone.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Clone.java Tue Oct 11 07:38:54 2005
@@ -25,10 +25,9 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Clones the given node to another workspace.
+ * Clone the given <code>Node</code> to another <code>Workspace</code>
  */
-public class Clone implements Command
-{
+public class Clone implements Command {
     /** logger */
     private static Log log = LogFactory.getLog(Clone.class);
 
@@ -46,10 +45,9 @@
     private String removeExistingKey = "removeExisting";
 
     /**
-     * @inheritDoc
+     * {@inheritDoc}
      */
-    public boolean execute(Context ctx) throws Exception
-    {
+    public boolean execute(Context ctx) throws Exception {
         String srcWorkspace = (String) ctx.get(this.srcWorkspaceKey);
         String srcAbsPath = (String) ctx.get(this.srcAbsPathKey);
         String destAbsPath = (String) ctx.get(this.destAbsPathKey);
@@ -58,8 +56,7 @@
 
         Workspace w = CommandHelper.getSession(ctx).getWorkspace();
 
-        if (log.isDebugEnabled())
-        {
+        if (log.isDebugEnabled()) {
             log.debug("cloning node. from [" + srcWorkspace + ":" + srcAbsPath
                     + "] to [" + w.getName() + ":" + destAbsPath + "]");
         }
@@ -70,43 +67,67 @@
         return false;
     }
 
-    public String getDestAbsPathKey()
-    {
+    /**
+     * @return the destination absolute path key
+     */
+    public String getDestAbsPathKey() {
         return destAbsPathKey;
     }
 
-    public void setDestAbsPathKey(String destAbsPathKey)
-    {
+    /**
+     * Sets the destination absolute path key
+     * @param destAbsPathKey
+     *        the destination absolute path key
+     */
+    public void setDestAbsPathKey(String destAbsPathKey) {
         this.destAbsPathKey = destAbsPathKey;
     }
 
-    public String getRemoveExistingKey()
-    {
+    /**
+     * @return the remove existing key option
+     */
+    public String getRemoveExistingKey() {
         return removeExistingKey;
     }
 
-    public void setRemoveExistingKey(String removeExistingKey)
-    {
+    /**
+     * Set the remove existing key option
+     * @param removeExistingKey
+     *        the remove existing key option
+     */
+    public void setRemoveExistingKey(String removeExistingKey) {
         this.removeExistingKey = removeExistingKey;
     }
 
-    public String getSrcAbsPathKey()
-    {
+    /**
+     * @return the source absolute path key
+     */
+    public String getSrcAbsPathKey() {
         return srcAbsPathKey;
     }
 
-    public void setSrcAbsPathKey(String srcAbsPathKey)
-    {
+    /**
+     * Sets the source absolute path key
+     * @param srcAbsPathKey
+     *        the source absolute path key
+     */
+    public void setSrcAbsPathKey(String srcAbsPathKey) {
         this.srcAbsPathKey = srcAbsPathKey;
     }
 
-    public String getSrcWorkspaceKey()
-    {
+    /**
+     * @return the source <code>Workspace</code> key
+     */
+    public String getSrcWorkspaceKey() {
         return srcWorkspaceKey;
     }
 
-    public void setSrcWorkspaceKey(String srcWorkspaceKey)
-    {
+    /**
+     * Sets the source <code>Workspace</code> key
+     * @param srcWorkspaceKey
+     *        the source <code>Workspace</code> key
+     */
+    public void setSrcWorkspaceKey(String srcWorkspaceKey) {
         this.srcWorkspaceKey = srcWorkspaceKey;
     }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Copy.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Copy.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Copy.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Copy.java Tue Oct 11 07:38:54 2005
@@ -25,80 +25,95 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Copy a Node. If the source workspace is null it will create a copy of the
- * given node from the current working workspace.
+ * Copy a Node. <br>
+ * If the source <code>Workspace</code> is unset it will create a copy of the
+ * given <code>Node</code> from the current working <code>Workspace</code>.
  */
-public class Copy implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(Copy.class);
-
-	// ---------------------------- < keys >
-	/**
-	 * Source workspace.
-	 */
-	private String srcWorkspaceKey = "srcWorkspace";
-
-	/** source path */
-	private String srcAbsPathKey = "srcAbsPath";
-
-	/** destination path */
-	private String destAbsPathKey = "destAbsPath";
-
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		String srcWorkspace = (String) ctx.get(this.srcWorkspaceKey);
-		String srcAbsPath = (String) ctx.get(this.srcAbsPathKey);
-		String destAbsPath = (String) ctx.get(this.destAbsPathKey);
-
-		Workspace w = CommandHelper.getSession(ctx).getWorkspace();
-		
-		if (srcWorkspace == null)
-		{
-			srcWorkspace = w.getName();
-		}
-
-		if (log.isDebugEnabled())
-		{
-			log.debug("copying node from [" + srcWorkspace + ":" + srcAbsPath
-					+ "] to [" + w.getName() + ":" + destAbsPath + "]");
-		}
-
-		w.copy(srcWorkspace, srcAbsPath, destAbsPath);
-
-		return false;
-	}
-
-	public String getDestAbsPathKey()
-	{
-		return destAbsPathKey;
-	}
-
-	public void setDestAbsPathKey(String destAbsPathKey)
-	{
-		this.destAbsPathKey = destAbsPathKey;
-	}
-
-	public String getSrcAbsPathKey()
-	{
-		return srcAbsPathKey;
-	}
-
-	public void setSrcAbsPathKey(String srcAbsPathKey)
-	{
-		this.srcAbsPathKey = srcAbsPathKey;
-	}
-
-	public String getSrcWorkspaceKey()
-	{
-		return srcWorkspaceKey;
-	}
-
-	public void setSrcWorkspaceKey(String srcWorkspaceKey)
-	{
-		this.srcWorkspaceKey = srcWorkspaceKey;
-	}
+public class Copy implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(Copy.class);
+
+    // ---------------------------- < keys >
+    /**
+     * Source workspace.
+     */
+    private String srcWorkspaceKey = "srcWorkspace";
+
+    /** source path */
+    private String srcAbsPathKey = "srcAbsPath";
+
+    /** destination path */
+    private String destAbsPathKey = "destAbsPath";
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String srcWorkspace = (String) ctx.get(this.srcWorkspaceKey);
+        String srcAbsPath = (String) ctx.get(this.srcAbsPathKey);
+        String destAbsPath = (String) ctx.get(this.destAbsPathKey);
+
+        Workspace w = CommandHelper.getSession(ctx).getWorkspace();
+
+        if (srcWorkspace == null) {
+            srcWorkspace = w.getName();
+        }
+
+        if (log.isDebugEnabled()) {
+            log.debug("copying node from [" + srcWorkspace + ":" + srcAbsPath
+                    + "] to [" + w.getName() + ":" + destAbsPath + "]");
+        }
+
+        w.copy(srcWorkspace, srcAbsPath, destAbsPath);
+
+        return false;
+    }
+
+    /**
+     * @return the destination absolute path key
+     */
+    public String getDestAbsPathKey() {
+        return destAbsPathKey;
+    }
+
+    /**
+     * sets the destination absolute path key
+     * @param destAbsPathKey
+     *        the destination absolute path key
+     */
+    public void setDestAbsPathKey(String destAbsPathKey) {
+        this.destAbsPathKey = destAbsPathKey;
+    }
+
+    /**
+     * @return the source absolute path key
+     */
+    public String getSrcAbsPathKey() {
+        return srcAbsPathKey;
+    }
+
+    /**
+     * Sets the source absolute path key
+     * @param srcAbsPathKey
+     *        the source absolute path key
+     */
+    public void setSrcAbsPathKey(String srcAbsPathKey) {
+        this.srcAbsPathKey = srcAbsPathKey;
+    }
+
+    /**
+     * @return the source <code>Workspace</code> key
+     */
+    public String getSrcWorkspaceKey() {
+        return srcWorkspaceKey;
+    }
+
+    /**
+     * Sets the source <code>Workspace</code> key
+     * @param srcWorkspaceKey
+     *        the source <code>Workspace</code> key
+     */
+    public void setSrcWorkspaceKey(String srcWorkspaceKey) {
+        this.srcWorkspaceKey = srcWorkspaceKey;
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/CurrentNode.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/CurrentNode.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/CurrentNode.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/CurrentNode.java Tue Oct 11 07:38:54 2005
@@ -25,44 +25,42 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Set the current working Node.
+ * Set the current working <code>Node</code>
  */
-public class CurrentNode implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(CurrentNode.class);
+public class CurrentNode implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(CurrentNode.class);
 
-	// ---------------------------- < keys >
+    // ---------------------------- < keys >
 
-	/** context attribute key for the path attribute */
-	private String pathKey = "path";
+    /** context attribute key for the path attribute */
+    private String pathKey = "path";
 
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		String dest = (String) ctx.get(this.pathKey);
-		Node n = CommandHelper.getNode(ctx, dest);
-		if (log.isDebugEnabled())
-		{
-			log.debug("set current working node to " + n.getPath());
-		}
-		CommandHelper.setCurrentNode(ctx, n);
-		return false;
-	}
     /**
-     * @return Returns the pathKey.
+     * {@inheritDoc}
      */
-    public String getPathKey()
-    {
+    public boolean execute(Context ctx) throws Exception {
+        String dest = (String) ctx.get(this.pathKey);
+        Node n = CommandHelper.getNode(ctx, dest);
+        if (log.isDebugEnabled()) {
+            log.debug("set current working node to " + n.getPath());
+        }
+        CommandHelper.setCurrentNode(ctx, n);
+        return false;
+    }
+
+    /**
+     * @return the path key
+     */
+    public String getPathKey() {
         return pathKey;
     }
+
     /**
-     * @param pathKey The pathKey to set.
+     * @param pathKey
+     *        the path key to set
      */
-    public void setPathKey(String pathKey)
-    {
+    public void setPathKey(String pathKey) {
         this.pathKey = pathKey;
     }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Login.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Login.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Login.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Login.java Tue Oct 11 07:38:54 2005
@@ -26,128 +26,104 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.command.CommandHelper;
-import org.apache.jackrabbit.command.CommandException;
 
 /**
- * Login command.
+ * Login to the current working <code>Repository<code>
  */
-public class Login implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(Login.class);
-
-	// ---------------------------- < keys >
-	/** user key */
-	private String userKey = "user";
-
-	/** password key */
-	private String passwordKey = "password";
-
-	/** workspace key */
-	private String workspaceKey = "workspace";
-
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		if (CommandHelper.getSession(ctx) != null)
-		{
-			throw new CommandException("exception.already.logged.in");
-		}
-
-		String anon = "anonymous";
-
-		String user = (String) ctx.get(this.userKey);
-		String password = (String) ctx.get(this.passwordKey);
-		String workspace = (String) ctx.get(this.workspaceKey);
-
-		if (user == null)
-		{
-			user = anon;
-		}
-
-		if (password == null)
-		{
-			password = anon;
-		}
-
-		if (log.isDebugEnabled())
-		{
-			log.debug("logging in as " + user);
-		}
-
-		Session session = null;
-		Repository repo = CommandHelper.getRepository(ctx);
-
-		if (repo == null)
-		{
-			throw new CommandException("exception.repository.not.in.context");
-		}
-
-		Credentials credentials = new SimpleCredentials(user, password
-				.toCharArray());
-
-		if (workspace == null)
-		{
-			session = repo.login(credentials);
-		} else
-		{
-			session = repo.login(credentials, workspace);
-		}
-		CommandHelper.setSession(ctx, session);
-		CommandHelper.setCurrentNode(ctx, session.getRootNode());
-		return false;
-	}
-
-	/**
-	 * @return Returns the passwordKey.
-	 */
-	public String getPasswordKey()
-	{
-		return passwordKey;
-	}
-
-	/**
-	 * @param passwordKey
-	 *            Set the context attribute key for the password attribute.
-	 */
-	public void setPasswordKey(String passwordKey)
-	{
-		this.passwordKey = passwordKey;
-	}
-
-	/**
-	 * @return Returns the userKey.
-	 */
-	public String getUserKey()
-	{
-		return userKey;
-	}
-
-	/**
-	 * @param userKey
-	 *            Set the context attribute key for the user attribute.
-	 */
-	public void setUserKey(String userKey)
-	{
-		this.userKey = userKey;
-	}
-
-	/**
-	 * @return Returns the workspaceKey.
-	 */
-	public String getWorkspaceKey()
-	{
-		return workspaceKey;
-	}
-
-	/**
-	 * @param workspaceKey
-	 *            Set the context attribute key for the workspace attribute.
-	 */
-	public void setWorkspaceKey(String workspaceKey)
-	{
-		this.workspaceKey = workspaceKey;
-	}
+public class Login implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(Login.class);
+
+    // ---------------------------- < keys >
+    /** user key */
+    private String userKey = "user";
+
+    /** password key */
+    private String passwordKey = "password";
+
+    /** workspace key */
+    private String workspaceKey = "workspace";
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String anon = "anonymous";
+
+        String user = (String) ctx.get(this.userKey);
+        String password = (String) ctx.get(this.passwordKey);
+        String workspace = (String) ctx.get(this.workspaceKey);
+
+        if (user == null) {
+            user = anon;
+        }
+
+        if (password == null) {
+            password = anon;
+        }
+
+        if (log.isDebugEnabled()) {
+            log.debug("logging in as " + user);
+        }
+
+        Session session = null;
+        Repository repo = CommandHelper.getRepository(ctx);
+
+        Credentials credentials = new SimpleCredentials(user, password
+            .toCharArray());
+
+        if (workspace == null) {
+            session = repo.login(credentials);
+        } else {
+            session = repo.login(credentials, workspace);
+        }
+        CommandHelper.setSession(ctx, session);
+        CommandHelper.setCurrentNode(ctx, session.getRootNode());
+        return false;
+    }
+
+    /**
+     * @return the password key
+     */
+    public String getPasswordKey() {
+        return passwordKey;
+    }
+
+    /**
+     * @param passwordKey
+     *        the password key to set
+     */
+    public void setPasswordKey(String passwordKey) {
+        this.passwordKey = passwordKey;
+    }
+
+    /**
+     * @return the user key.
+     */
+    public String getUserKey() {
+        return userKey;
+    }
+
+    /**
+     * @param userKey
+     *        the user key to set
+     */
+    public void setUserKey(String userKey) {
+        this.userKey = userKey;
+    }
+
+    /**
+     * @return the <code>Workspace</code>.
+     */
+    public String getWorkspaceKey() {
+        return workspaceKey;
+    }
+
+    /**
+     * @param workspaceKey
+     *        the <code>Workspace<code> key to set
+     */
+    public void setWorkspaceKey(String workspaceKey) {
+        this.workspaceKey = workspaceKey;
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Logout.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Logout.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Logout.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Logout.java Tue Oct 11 07:38:54 2005
@@ -25,28 +25,24 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Logout command
+ * Logout from the current working <code>Repository</code>
  */
-public class Logout implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(Logout.class);
+public class Logout implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(Logout.class);
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.commons.chain.Command#execute(org.apache.commons.chain.Context)
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		Session s = CommandHelper.getSession(ctx);
-		if (log.isDebugEnabled())
-		{
-			log.debug("logging out user " + s.getUserID());
-		}
-		s.logout();
-		CommandHelper.setCurrentNode(ctx, null);
-		CommandHelper.setSession(ctx, null);
-		return false;
-	}
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        Session s = CommandHelper.getSession(ctx);
+        if (log.isDebugEnabled()) {
+            log.debug("logging out user " + s.getUserID());
+        }
+        s.logout();
+        CommandHelper.setCurrentNode(ctx, null);
+        CommandHelper.setSession(ctx, null);
+        return false;
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Move.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Move.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Move.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Move.java Tue Oct 11 07:38:54 2005
@@ -27,10 +27,9 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Move a Node.
+ * Move a <code>Node</code>
  */
-public class Move implements Command
-{
+public class Move implements Command {
     /** resource bundle */
     private static ResourceBundle bundle = CommandHelper.getBundle();
 
@@ -45,25 +44,23 @@
     private String destAbsPathKey = "destAbsPath";
 
     /**
-     * @inheritDoc
+     * {@inheritDoc}
      */
-    public boolean execute(Context ctx) throws Exception
-    {
+    public boolean execute(Context ctx) throws Exception {
         String srcAbsPath = (String) ctx.get(this.srcAbsPathKey);
         String destAbsPath = (String) ctx.get(this.destAbsPathKey);
 
-        if (!srcAbsPath.startsWith("/") || !destAbsPath.startsWith("/"))
-        {
-            throw new IllegalArgumentException(
-                bundle.getString("exception.illegalargument")
-                + ". " + 
-                bundle.getString("exception.only.absolute.path") + ".");
+        if (!srcAbsPath.startsWith("/") || !destAbsPath.startsWith("/")) {
+            throw new IllegalArgumentException(bundle
+                .getString("exception.illegalargument")
+                    + ". "
+                    + bundle.getString("exception.only.absolute.path")
+                    + ".");
         }
 
         Workspace w = CommandHelper.getSession(ctx).getWorkspace();
 
-        if (log.isDebugEnabled())
-        {
+        if (log.isDebugEnabled()) {
             log.debug("moving node from " + srcAbsPath + " to " + destAbsPath);
         }
 
@@ -73,36 +70,32 @@
     }
 
     /**
-     * @return Returns the destAbsPathKey.
+     * @return the destintation absolute path key
      */
-    public String getDestAbsPathKey()
-    {
+    public String getDestAbsPathKey() {
         return destAbsPathKey;
     }
 
     /**
      * @param destAbsPathKey
-     *            The destAbsPathKey to set.
+     *        the destintation absolute path key to set
      */
-    public void setDestAbsPathKey(String destAbsPathKey)
-    {
+    public void setDestAbsPathKey(String destAbsPathKey) {
         this.destAbsPathKey = destAbsPathKey;
     }
 
     /**
-     * @return Returns the srcAbsPathKey.
+     * @return the source absolute path key
      */
-    public String getSrcAbsPathKey()
-    {
+    public String getSrcAbsPathKey() {
         return srcAbsPathKey;
     }
 
     /**
      * @param srcAbsPathKey
-     *            The srcAbsPathKey to set.
+     *        the source absolute path key to set
      */
-    public void setSrcAbsPathKey(String srcAbsPathKey)
-    {
+    public void setSrcAbsPathKey(String srcAbsPathKey) {
         this.srcAbsPathKey = srcAbsPathKey;
     }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/OrderBefore.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/OrderBefore.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/OrderBefore.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/OrderBefore.java Tue Oct 11 07:38:54 2005
@@ -25,10 +25,9 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Sets the order of the given node.
+ * Set the order of the given <code>Node</code>
  */
-public class OrderBefore implements Command
-{
+public class OrderBefore implements Command {
     /** logger */
     private static Log log = LogFactory.getLog(OrderBefore.class);
 
@@ -42,19 +41,21 @@
     /** destination path */
     private String destChildKey = "destChild";
 
-    public boolean execute(Context ctx) throws Exception
-    {
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
         String parentPath = (String) ctx.get(this.parentPathKey);
         Node n = CommandHelper.getNode(ctx, parentPath);
 
         String srcChildPath = (String) ctx.get(this.srcChildKey);
         String destChildPath = (String) ctx.get(this.destChildKey);
 
-        if (log.isDebugEnabled())
-        {
-            log.debug("ordering before. from " + n.getPath() + "/"
-                    + srcChildPath + " to " + n.getPath() + "/"
-                    + destChildPath);
+        if (log.isDebugEnabled()) {
+            log
+                .debug("ordering before. from " + n.getPath() + "/"
+                        + srcChildPath + " to " + n.getPath() + "/"
+                        + destChildPath);
         }
 
         n.orderBefore(srcChildPath, destChildPath);
@@ -62,40 +63,48 @@
         return false;
     }
 
-    public String getDestChildKey()
-    {
+    /**
+     * @return the destination child key
+     */
+    public String getDestChildKey() {
         return destChildKey;
     }
 
-    public void setDestChildKey(String destChildRelPathKey)
-    {
+    /**
+     * @param destChildRelPathKey
+     *        the destination child key to set
+     */
+    public void setDestChildKey(String destChildRelPathKey) {
         this.destChildKey = destChildRelPathKey;
     }
 
-    public String getSrcChildKey()
-    {
+    /**
+     * @return the source child key
+     */
+    public String getSrcChildKey() {
         return srcChildKey;
     }
 
-    public void setSrcChildKey(String srcChildRelPathKey)
-    {
+    /**
+     * @param srcChildRelPathKey
+     *        the source child key to set
+     */
+    public void setSrcChildKey(String srcChildRelPathKey) {
         this.srcChildKey = srcChildRelPathKey;
     }
 
     /**
-     * @return Returns the parentPathKey.
+     * @return the parent path key
      */
-    public String getParentPathKey()
-    {
+    public String getParentPathKey() {
         return parentPathKey;
     }
 
     /**
      * @param parentPathKey
-     *            The parentPathKey to set.
+     *        the parent path key to set
      */
-    public void setParentPathKey(String parentPathKey)
-    {
+    public void setParentPathKey(String parentPathKey) {
         this.parentPathKey = parentPathKey;
     }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/ReadValue.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/ReadValue.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/ReadValue.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/ReadValue.java Tue Oct 11 07:38:54 2005
@@ -25,108 +25,94 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Read the Value of the given property and store it under the given context
- * attribute.
+ * Read the <code>Value</code> of the given <code>Property</code> and store
+ * it under the given <code>Context</code> attribute.
  */
-public class ReadValue implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(ReadValue.class);
-
-	// ---------------------------- < keys >
-
-	/** property path key */
-	private String srcPathKey = "srcPath";
-
-	/** value index key */
-	private String srcIndexKey = "srcIndex";
-
-	/** destination context attribute */
-	private String destKey = "dest";
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.commons.chain.Command#execute(org.apache.commons.chain.Context)
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		String path = (String) ctx.get(this.srcPathKey);
-		int index = 1;
-		if (ctx.get(this.srcIndexKey) != null)
-		{
-			index = Integer.valueOf(((String) ctx.get(this.srcIndexKey)))
-					.intValue();
-		}
-
-		String dest = (String) ctx.get(this.destKey);
-
-		if (log.isDebugEnabled())
-		{
-			log.debug("reading value from " + path + "[" + index + "] to "
-					+ dest);
-		}
-
-		Property p = (Property) CommandHelper.getItem(ctx, path);
-
-		if (p.getDefinition().isMultiple())
-		{
-			ctx.put(dest, p.getValues()[index].getString());
-		} else
-		{
-			ctx.put(dest, p.getValue().getString());
-		}
-		return false;
-	}
-
-	/**
-	 * @return Returns the destKey.
-	 */
-	public String getDestKey()
-	{
-		return destKey;
-	}
-
-	/**
-	 * @param destKey
-	 *            The destKey to set.
-	 */
-	public void setDestKey(String destKey)
-	{
-		this.destKey = destKey;
-	}
-
-	/**
-	 * @return Returns the srcIndexKey.
-	 */
-	public String getSrcIndexKey()
-	{
-		return srcIndexKey;
-	}
-
-	/**
-	 * @param srcIndexKey
-	 *            The srcIndexKey to set.
-	 */
-	public void setSrcIndexKey(String srcIndexKey)
-	{
-		this.srcIndexKey = srcIndexKey;
-	}
-
-	/**
-	 * @return Returns the srcPathKey.
-	 */
-	public String getSrcPathKey()
-	{
-		return srcPathKey;
-	}
-
-	/**
-	 * @param srcPathKey
-	 *            The srcPathKey to set.
-	 */
-	public void setSrcPathKey(String srcPathKey)
-	{
-		this.srcPathKey = srcPathKey;
-	}
+public class ReadValue implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(ReadValue.class);
+
+    // ---------------------------- < keys >
+
+    /** property path key */
+    private String srcPathKey = "srcPath";
+
+    /** value index key */
+    private String srcIndexKey = "srcIndex";
+
+    /** destination context attribute */
+    private String destKey = "dest";
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String path = (String) ctx.get(this.srcPathKey);
+        int index = 1;
+        if (ctx.get(this.srcIndexKey) != null) {
+            index = Integer.valueOf(((String) ctx.get(this.srcIndexKey)))
+                .intValue();
+        }
+
+        String dest = (String) ctx.get(this.destKey);
+
+        if (log.isDebugEnabled()) {
+            log.debug("reading value from " + path + "[" + index + "] to "
+                    + dest);
+        }
+
+        Property p = (Property) CommandHelper.getItem(ctx, path);
+
+        if (p.getDefinition().isMultiple()) {
+            ctx.put(dest, p.getValues()[index].getString());
+        } else {
+            ctx.put(dest, p.getValue().getString());
+        }
+        return false;
+    }
+
+    /**
+     * @return the destination key
+     */
+    public String getDestKey() {
+        return destKey;
+    }
+
+    /**
+     * @param destKey
+     *        the destination key to set
+     */
+    public void setDestKey(String destKey) {
+        this.destKey = destKey;
+    }
+
+    /**
+     * @return the source index key
+     */
+    public String getSrcIndexKey() {
+        return srcIndexKey;
+    }
+
+    /**
+     * @param srcIndexKey
+     *        the source index key to set
+     */
+    public void setSrcIndexKey(String srcIndexKey) {
+        this.srcIndexKey = srcIndexKey;
+    }
+
+    /**
+     * @return the source path key
+     */
+    public String getSrcPathKey() {
+        return srcPathKey;
+    }
+
+    /**
+     * @param srcPathKey
+     *        the source path key to set
+     */
+    public void setSrcPathKey(String srcPathKey) {
+        this.srcPathKey = srcPathKey;
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Refresh.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Refresh.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Refresh.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Refresh.java Tue Oct 11 07:38:54 2005
@@ -26,80 +26,71 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Refresh the session to reflect the current saved state. <br>
- * If the path is set then only that Item is refreshed.
+ * Refresh the <code>Item</code> if specified or the <code>Session</code> to
+ * reflect the current saved state.
  */
-public class Refresh implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(Refresh.class);
-
-	// ---------------------------- < keys >
-	/** keep changes key */
-	private String keepChangesKey = "keepChanges";
-
-	/** path to the node to refresh key */
-	private String pathKey = "path";
-
-	/**
-	 * @return Returns the keepChangesKey.
-	 */
-	public String getKeepChangesKey()
-	{
-		return keepChangesKey;
-	}
-
-	/**
-	 * @param keepChangesKey
-	 *            The keepChangesKey to set.
-	 */
-	public void setKeepChangesKey(String keepChangesKey)
-	{
-		this.keepChangesKey = keepChangesKey;
-	}
-
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		boolean keepChanges = Boolean.valueOf(
-				(String) ctx.get(this.keepChangesKey)).booleanValue();
-
-		String path = (String) ctx.get(this.pathKey);
-
-		if (log.isDebugEnabled())
-		{
-			log.debug("refreshing. from node " + path);
-		}
-
-		if (path == null)
-		{
-			Session s = CommandHelper.getSession(ctx);
-			s.refresh(keepChanges);
-		} else
-		{
-			Item i = CommandHelper.getItem(ctx, path);
-			i.refresh(keepChanges);
-		}
-
-		return false;
-	}
-
-	/**
-	 * @return Returns the pathKey.
-	 */
-	public String getPathKey()
-	{
-		return pathKey;
-	}
-
-	/**
-	 * @param pathKey
-	 *            The pathKey to set.
-	 */
-	public void setPathKey(String pathKey)
-	{
-		this.pathKey = pathKey;
-	}
+public class Refresh implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(Refresh.class);
+
+    // ---------------------------- < keys >
+    /** keep changes key */
+    private String keepChangesKey = "keepChanges";
+
+    /** path to the node to refresh key */
+    private String pathKey = "path";
+
+    /**
+     * @return the keep changes key
+     */
+    public String getKeepChangesKey() {
+        return keepChangesKey;
+    }
+
+    /**
+     * @param keepChangesKey
+     *        the keep changes key to set
+     */
+    public void setKeepChangesKey(String keepChangesKey) {
+        this.keepChangesKey = keepChangesKey;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        boolean keepChanges = Boolean.valueOf(
+            (String) ctx.get(this.keepChangesKey)).booleanValue();
+
+        String path = (String) ctx.get(this.pathKey);
+
+        if (log.isDebugEnabled()) {
+            log.debug("refreshing. from node " + path);
+        }
+
+        if (path == null) {
+            Session s = CommandHelper.getSession(ctx);
+            s.refresh(keepChanges);
+        } else {
+            Item i = CommandHelper.getItem(ctx, path);
+            i.refresh(keepChanges);
+        }
+
+        return false;
+    }
+
+    /**
+     * @return the path key
+     */
+    public String getPathKey() {
+        return pathKey;
+    }
+
+    /**
+     * @param pathKey
+     *        the path key to set
+     */
+    public void setPathKey(String pathKey) {
+        this.pathKey = pathKey;
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/RemoveItem.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/RemoveItem.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/RemoveItem.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/RemoveItem.java Tue Oct 11 07:38:54 2005
@@ -25,52 +25,46 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Removes the item at the given path.
+ * Remove the <code>Item</code> at the given path
  */
-public class RemoveItem implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(RemoveItem.class);
+public class RemoveItem implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(RemoveItem.class);
 
-	// ---------------------------- < keys >
+    // ---------------------------- < keys >
 
-	/** context attribute key for the path attribute */
-	private String pathKey = "path";
+    /** context attribute key for the path attribute */
+    private String pathKey = "path";
 
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		String path = (String) ctx.get(this.pathKey);
-		if (log.isDebugEnabled())
-		{
-			log.debug("removing item from " + path);
-		}
-		Item item = CommandHelper.getItem(ctx, path);
-		if (item.isSame(CommandHelper.getCurrentNode(ctx))
-				&& item.getDepth() > 0)
-		{
-			CommandHelper.setCurrentNode(ctx, item.getParent());
-		}
-		item.remove();
-		return false;
-	}
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String path = (String) ctx.get(this.pathKey);
+        if (log.isDebugEnabled()) {
+            log.debug("removing item from " + path);
+        }
+        Item item = CommandHelper.getItem(ctx, path);
+        if (item.isSame(CommandHelper.getCurrentNode(ctx))
+                && item.getDepth() > 0) {
+            CommandHelper.setCurrentNode(ctx, item.getParent());
+        }
+        item.remove();
+        return false;
+    }
 
-	/**
-	 * @return Returns the pathKey.
-	 */
-	public String getPathKey()
-	{
-		return pathKey;
-	}
+    /**
+     * @return the path key
+     */
+    public String getPathKey() {
+        return pathKey;
+    }
 
-	/**
-	 * @param pathKey
-	 *            The pathKey to set.
-	 */
-	public void setPathKey(String pathKey)
-	{
-		this.pathKey = pathKey;
-	}
+    /**
+     * @param pathKey
+     *        the path key to set
+     */
+    public void setPathKey(String pathKey) {
+        this.pathKey = pathKey;
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/RemoveItems.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/RemoveItems.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/RemoveItems.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/RemoveItems.java Tue Oct 11 07:38:54 2005
@@ -31,88 +31,80 @@
 import org.apache.jackrabbit.util.ChildrenCollectorFilter;
 
 /**
- * Removes any item under the given node that match the given name pattern.
+ * Remove any <code>Item</code> under the given <code>Node</code> that match
+ * the given name pattern.
  */
-public class RemoveItems implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(RemoveItems.class);
-
-	// ---------------------------- < keys >
-	/** path key */
-	private String pathKey = "path";
-
-	/** item pattern key */
-	private String patternKey = "pattern";
-
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		String pattern = (String) ctx.get(this.patternKey);
-		String path = (String) ctx.get(this.pathKey);
-
-		Node n = CommandHelper.getNode(ctx, path);
-
-		if (log.isDebugEnabled())
-		{
-			log.debug("removing nodes from " + n.getPath()
-					+ " that match pattern " + pattern);
-		}
-
-		List children = new ArrayList();
-		ChildrenCollectorFilter collector = new ChildrenCollectorFilter(
-				pattern, children, true, true, 1);
-		collector.visit(n);
-
-		Iterator items = children.iterator();
-
-		while (items.hasNext())
-		{
-			Item item = (Item) items.next();
-			if (item.isSame(CommandHelper.getCurrentNode(ctx))
-					&& item.getDepth() > 0)
-			{
-				CommandHelper.setCurrentNode(ctx, item.getParent());
-			}
-			item.remove();
-		}
-
-		return false;
-	}
-
-	/**
-	 * @return Returns the patternKey.
-	 */
-	public String getPatternKey()
-	{
-		return patternKey;
-	}
-
-	/**
-	 * @param patternKey
-	 *            Set the context attribute key for the pattern attribute.
-	 */
-	public void setPatternKey(String patternKey)
-	{
-		this.patternKey = patternKey;
-	}
-
-	/**
-	 * @return Returns the pathKey.
-	 */
-	public String getPathKey()
-	{
-		return pathKey;
-	}
-
-	/**
-	 * @param pathKey
-	 *            The pathKey to set.
-	 */
-	public void setPathKey(String pathKey)
-	{
-		this.pathKey = pathKey;
-	}
+public class RemoveItems implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(RemoveItems.class);
+
+    // ---------------------------- < keys >
+    /** path key */
+    private String pathKey = "path";
+
+    /** item pattern key */
+    private String patternKey = "pattern";
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String pattern = (String) ctx.get(this.patternKey);
+        String path = (String) ctx.get(this.pathKey);
+
+        Node n = CommandHelper.getNode(ctx, path);
+
+        if (log.isDebugEnabled()) {
+            log.debug("removing nodes from " + n.getPath()
+                    + " that match pattern " + pattern);
+        }
+
+        List children = new ArrayList();
+        ChildrenCollectorFilter collector = new ChildrenCollectorFilter(
+            pattern, children, true, true, 1);
+        collector.visit(n);
+
+        Iterator items = children.iterator();
+
+        while (items.hasNext()) {
+            Item item = (Item) items.next();
+            if (item.isSame(CommandHelper.getCurrentNode(ctx))
+                    && item.getDepth() > 0) {
+                CommandHelper.setCurrentNode(ctx, item.getParent());
+            }
+            item.remove();
+        }
+
+        return false;
+    }
+
+    /**
+     * @return the pattern key
+     */
+    public String getPatternKey() {
+        return patternKey;
+    }
+
+    /**
+     * @param patternKey
+     *        the pattern key to set
+     */
+    public void setPatternKey(String patternKey) {
+        this.patternKey = patternKey;
+    }
+
+    /**
+     * @return the path key
+     */
+    public String getPathKey() {
+        return pathKey;
+    }
+
+    /**
+     * @param pathKey
+     *        the path key to set
+     */
+    public void setPathKey(String pathKey) {
+        this.pathKey = pathKey;
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Rename.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Rename.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Rename.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Rename.java Tue Oct 11 07:38:54 2005
@@ -26,10 +26,9 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Rename a node
+ * Rename a <code>Node<code>
  */
-public class Rename implements Command
-{
+public class Rename implements Command {
     /** logger */
     private static Log log = LogFactory.getLog(Rename.class);
 
@@ -41,25 +40,21 @@
     private String destPathKey = "destPath";
 
     /**
-     * @inheritDoc
+     * {@inheritDoc}
      */
-    public boolean execute(Context ctx) throws Exception
-    {
+    public boolean execute(Context ctx) throws Exception {
         String from = (String) ctx.get(this.srcPathKey);
         String to = (String) ctx.get(this.destPathKey);
 
-        if (log.isDebugEnabled())
-        {
+        if (log.isDebugEnabled()) {
             log.debug("renaming node from " + from + " to " + to);
         }
 
         Session s = CommandHelper.getSession(ctx);
         Node nodeFrom = CommandHelper.getNode(ctx, from);
-        if (nodeFrom.getDepth() == 1)
-        {
+        if (nodeFrom.getDepth() == 1) {
             s.move(nodeFrom.getPath(), "/" + to);
-        } else
-        {
+        } else {
             s.move(nodeFrom.getPath(), nodeFrom.getParent().getPath() + "/"
                     + to);
         }
@@ -67,23 +62,33 @@
         return false;
     }
 
-    public String getDestPathKey()
-    {
+    /**
+     * @return the destination path key
+     */
+    public String getDestPathKey() {
         return destPathKey;
     }
 
-    public void setDestPathKey(String destPathKey)
-    {
+    /**
+     * @param destPathKey
+     *        the destination path key to set
+     */
+    public void setDestPathKey(String destPathKey) {
         this.destPathKey = destPathKey;
     }
 
-    public String getSrcPathKey()
-    {
+    /**
+     * @return the source path key
+     */
+    public String getSrcPathKey() {
         return srcPathKey;
     }
 
-    public void setSrcPathKey(String srcPathKey)
-    {
+    /**
+     * @param srcPathKey
+     *        the source path key to set
+     */
+    public void setSrcPathKey(String srcPathKey) {
         this.srcPathKey = srcPathKey;
     }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Save.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Save.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Save.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Save.java Tue Oct 11 07:38:54 2005
@@ -25,53 +25,47 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Saves the current working node. <br>
- * 
+ * Save the current working <code>Node</code> if specified, or the current
+ * working <code>Session</code>
  */
-public class Save implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(Save.class);
-
-	// ---------------------------- < keys >
-	/** path key */
-	private String pathKey = "path";
-
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		String path = (String) ctx.get(this.pathKey);
-
-		if (path == null)
-		{
-			log.debug("saving session");
-			CommandHelper.getSession(ctx).save();
-		} else
-		{
-			log.debug("saving node at " + path);
-			Node n = CommandHelper.getNode(ctx, path);
-			n.save();
-		}
-
-		return false;
-	}
-
-	/**
-	 * @return Returns the pathKey.
-	 */
-	public String getPathKey()
-	{
-		return pathKey;
-	}
-
-	/**
-	 * @param pathKey
-	 *            The pathKey to set.
-	 */
-	public void setPathKey(String pathKey)
-	{
-		this.pathKey = pathKey;
-	}
+public class Save implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(Save.class);
+
+    // ---------------------------- < keys >
+    /** path key */
+    private String pathKey = "path";
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String path = (String) ctx.get(this.pathKey);
+
+        if (path == null) {
+            log.debug("saving session");
+            CommandHelper.getSession(ctx).save();
+        } else {
+            log.debug("saving node at " + path);
+            Node n = CommandHelper.getNode(ctx, path);
+            n.save();
+        }
+
+        return false;
+    }
+
+    /**
+     * @return the path key
+     */
+    public String getPathKey() {
+        return pathKey;
+    }
+
+    /**
+     * @param pathKey
+     *        the path key to set
+     */
+    public void setPathKey(String pathKey) {
+        this.pathKey = pathKey;
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/SetMultivalueProperty.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/SetMultivalueProperty.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/SetMultivalueProperty.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/SetMultivalueProperty.java Tue Oct 11 07:38:54 2005
@@ -25,66 +25,60 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Set a multivalue property to the current working node. <br>
+ * Set a multivalue <code>Property</code> to the current working
+ * <code>Node</code>.<br>
  * The default regular expression is ",".
  */
-public class SetMultivalueProperty extends AbstractSetProperty
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(SetMultivalueProperty.class);
-
-	// ---------------------------- < keys >
-
-	/** regular expression key */
-	private String regExpKey = "regExp";
-
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		String regExp = (String) ctx.get(this.regExpKey);
-		String value = (String) ctx.get(this.valueKey);
-		String name = (String) ctx.get(this.nameKey);
-		String type = (String) ctx.get(this.typeKey);
-		String parent = (String) ctx.get(this.parentPathKey);
-
-		Node node = CommandHelper.getNode(ctx, parent);
-
-		if (log.isDebugEnabled())
-		{
-			log.debug("setting multivalue property from node at "
-					+ node.getPath() + ". regexp=" + regExp + " value=" + value
-					+ " property=" + name);
-		}
-
-		String[] values = value.split(regExp);
-
-		if (type == null)
-		{
-			node.setProperty(name, values);
-		} else
-		{
-			node.setProperty(name, values, PropertyType.valueFromName(type));
-		}
-
-		return false;
-	}
-
-	/**
-	 * @return Returns the regExpKey.
-	 */
-	public String getRegExpKey()
-	{
-		return regExpKey;
-	}
-
-	/**
-	 * @param regExpKey
-	 *            Set the context attribute key for the regExp attribute.
-	 */
-	public void setRegExpKey(String regExpKey)
-	{
-		this.regExpKey = regExpKey;
-	}
+public class SetMultivalueProperty extends AbstractSetProperty {
+    /** logger */
+    private static Log log = LogFactory.getLog(SetMultivalueProperty.class);
+
+    // ---------------------------- < keys >
+
+    /** regular expression key */
+    private String regExpKey = "regExp";
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String regExp = (String) ctx.get(this.regExpKey);
+        String value = (String) ctx.get(this.valueKey);
+        String name = (String) ctx.get(this.nameKey);
+        String type = (String) ctx.get(this.typeKey);
+        String parent = (String) ctx.get(this.parentPathKey);
+
+        Node node = CommandHelper.getNode(ctx, parent);
+
+        if (log.isDebugEnabled()) {
+            log.debug("setting multivalue property from node at "
+                    + node.getPath() + ". regexp=" + regExp + " value=" + value
+                    + " property=" + name);
+        }
+
+        String[] values = value.split(regExp);
+
+        if (type == null) {
+            node.setProperty(name, values);
+        } else {
+            node.setProperty(name, values, PropertyType.valueFromName(type));
+        }
+
+        return false;
+    }
+
+    /**
+     * @return the regular expression key
+     */
+    public String getRegExpKey() {
+        return regExpKey;
+    }
+
+    /**
+     * @param regExpKey
+     *        the regular expression key to set
+     */
+    public void setRegExpKey(String regExpKey) {
+        this.regExpKey = regExpKey;
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/SetProperty.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/SetProperty.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/SetProperty.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/SetProperty.java Tue Oct 11 07:38:54 2005
@@ -25,38 +25,34 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Sets a property to the current working Node
+ * Set a <code>Property</code> <code>Value</code> to the current working
+ * <code>Node</code>
  */
-public class SetProperty extends AbstractSetProperty
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(SetProperty.class);
+public class SetProperty extends AbstractSetProperty {
+    /** logger */
+    private static Log log = LogFactory.getLog(SetProperty.class);
 
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		String value = (String) ctx.get(this.valueKey);
-		String name = (String) ctx.get(this.nameKey);
-		String propertyType = (String) ctx.get(this.typeKey);
-		String parent = (String) ctx.get(this.parentPathKey);
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String value = (String) ctx.get(this.valueKey);
+        String name = (String) ctx.get(this.nameKey);
+        String propertyType = (String) ctx.get(this.typeKey);
+        String parent = (String) ctx.get(this.parentPathKey);
 
-		Node node = CommandHelper.getNode(ctx, parent);
-		if (log.isDebugEnabled())
-		{
-			log.debug("setting property to node at " + node.getPath()
-					+ ". property=" + name + " value=" + value);
-		}
-		if (propertyType == null)
-		{
-			node.setProperty(name, value);
-		} else
-		{
-			node.setProperty(name, value, PropertyType
-					.valueFromName(propertyType));
-		}
-		return false;
-	}
+        Node node = CommandHelper.getNode(ctx, parent);
+        if (log.isDebugEnabled()) {
+            log.debug("setting property to node at " + node.getPath()
+                    + ". property=" + name + " value=" + value);
+        }
+        if (propertyType == null) {
+            node.setProperty(name, value);
+        } else {
+            node.setProperty(name, value, PropertyType
+                .valueFromName(propertyType));
+        }
+        return false;
+    }
 
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/ConnectToRmiServer.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/ConnectToRmiServer.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/ConnectToRmiServer.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/ConnectToRmiServer.java Tue Oct 11 07:38:54 2005
@@ -28,45 +28,40 @@
 /**
  * Connect to a JCR-RMI server
  */
-public class ConnectToRmiServer implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(ConnectToRmiServer.class);
+public class ConnectToRmiServer implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(ConnectToRmiServer.class);
 
-	// ---------------------------- < keys >
-	/** url key */
-	private String urlKey = "url";
+    // ---------------------------- < keys >
+    /** url key */
+    private String urlKey = "url";
 
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		String url = (String) ctx.get(this.urlKey);
-		if (log.isDebugEnabled())
-		{
-			log.debug("connecting to jcr-rmi server at " + url);
-		}
-		ClientRepositoryFactory factory = new ClientRepositoryFactory();
-		Repository repository = factory.getRepository(url);
-		CommandHelper.setRepository(ctx, repository);
-		return false;
-	}
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String url = (String) ctx.get(this.urlKey);
+        if (log.isDebugEnabled()) {
+            log.debug("connecting to jcr-rmi server at " + url);
+        }
+        ClientRepositoryFactory factory = new ClientRepositoryFactory();
+        Repository repository = factory.getRepository(url);
+        CommandHelper.setRepository(ctx, repository);
+        return false;
+    }
 
-	/**
-	 * @return Returns the urlKey.
-	 */
-	public String getUrlKey()
-	{
-		return urlKey;
-	}
+    /**
+     * @return the url key
+     */
+    public String getUrlKey() {
+        return urlKey;
+    }
 
-	/**
-	 * @param urlKey
-	 *            The urlKey to set.
-	 */
-	public void setUrlKey(String urlKey)
-	{
-		this.urlKey = urlKey;
-	}
+    /**
+     * @param urlKey
+     *            the url key to set
+     */
+    public void setUrlKey(String urlKey) {
+        this.urlKey = urlKey;
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/CreateWorkspace.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/CreateWorkspace.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/CreateWorkspace.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/CreateWorkspace.java Tue Oct 11 07:38:54 2005
@@ -31,45 +31,49 @@
  * Creates a Workspace.<br>
  * Note that this Command uses Jackrabbit specific API.
  */
-public class CreateWorkspace implements Command
-{
-	/** bundle */
-	ResourceBundle bundle = CommandHelper.getBundle();
-
-	/** logger */
-	private static Log log = LogFactory.getLog(CreateWorkspace.class);
-
-	// ---------------------------- < keys >
-	/** workspace name key */
-	private String nameKey = "name";
-
-	public boolean execute(Context ctx) throws Exception
-	{
-		String name = (String) ctx.get(this.nameKey);
-		if (log.isDebugEnabled())
-		{
-			log.debug("creating workspace for name " + name);
-		}
-		Workspace w = CommandHelper.getSession(ctx).getWorkspace();
-		if (w instanceof WorkspaceImpl == false)
-		{
-			throw new IllegalStateException(bundle
-					.getString("phrase.jackrabbit.command"));
-		}
-
-		WorkspaceImpl jrw = (WorkspaceImpl) w;
-		jrw.createWorkspace(name);
-		return false;
-	}
-
-	public String getNameKey()
-	{
-		return nameKey;
-	}
-
-	public void setNameKey(String nameKey)
-	{
-		this.nameKey = nameKey;
-	}
+public class CreateWorkspace implements Command {
+    /** bundle */
+    private ResourceBundle bundle = CommandHelper.getBundle();
+
+    /** logger */
+    private static Log log = LogFactory.getLog(CreateWorkspace.class);
+
+    // ---------------------------- < keys >
+    /** workspace name key */
+    private String nameKey = "name";
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String name = (String) ctx.get(this.nameKey);
+        if (log.isDebugEnabled()) {
+            log.debug("creating workspace for name " + name);
+        }
+        Workspace w = CommandHelper.getSession(ctx).getWorkspace();
+        if (!(w instanceof WorkspaceImpl)) {
+            throw new IllegalStateException(bundle
+                    .getString("phrase.jackrabbit.command"));
+        }
+
+        WorkspaceImpl jrw = (WorkspaceImpl) w;
+        jrw.createWorkspace(name);
+        return false;
+    }
+
+    /**
+     * @return the name key
+     */
+    public String getNameKey() {
+        return nameKey;
+    }
+
+    /**
+     * @param nameKey
+     *            the name key to set
+     */
+    public void setNameKey(String nameKey) {
+        this.nameKey = nameKey;
+    }
 
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/RegisterNodeType.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/RegisterNodeType.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/RegisterNodeType.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/RegisterNodeType.java Tue Oct 11 07:38:54 2005
@@ -22,11 +22,13 @@
 /**
  * Register a node type
  */
-public class RegisterNodeType implements Command
-{
-	public boolean execute(Context arg0) throws Exception
-	{
-		throw new UnsupportedOperationException("not implemented yet");
-	}
+public class RegisterNodeType implements Command {
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context arg0) throws Exception {
+        throw new UnsupportedOperationException("not implemented yet");
+    }
 
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/StartJackrabbit.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/StartJackrabbit.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/StartJackrabbit.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/StartJackrabbit.java Tue Oct 11 07:38:54 2005
@@ -27,12 +27,9 @@
 import org.apache.jackrabbit.core.config.RepositoryConfig;
 
 /**
- * <p>
- * Starts a Jackrabbit instance and put it in the <code>Context</code>.
- * </p>
+ * Set a new Jackrabbit instance as the current working <code>Repository</code>
  */
-public class StartJackrabbit implements Command
-{
+public class StartJackrabbit implements Command {
     /** logger */
     private static Log log = LogFactory.getLog(StartJackrabbit.class);
 
@@ -43,17 +40,15 @@
     private String homeKey = "home";
 
     /**
-     * @inheritDoc
+     * {@inheritDoc}
      */
-    public boolean execute(Context ctx) throws Exception
-    {
+    public boolean execute(Context ctx) throws Exception {
         String config = (String) ctx.get(this.configKey);
         String home = (String) ctx.get(this.homeKey);
-        if (log.isDebugEnabled())
-        {
+        if (log.isDebugEnabled()) {
             log
-                .debug("starting jackrabbit. config=" + config + " home="
-                        + home);
+                    .debug("starting jackrabbit. config=" + config + " home="
+                            + home);
         }
         RepositoryConfig conf = RepositoryConfig.create(config, home);
         Repository repo = RepositoryImpl.create(conf);
@@ -61,23 +56,33 @@
         return false;
     }
 
-    public String getConfigKey()
-    {
+    /**
+     * @return the config key
+     */
+    public String getConfigKey() {
         return configKey;
     }
 
-    public void setConfigKey(String configKey)
-    {
+    /**
+     * @param configKey
+     *            the config key to set
+     */
+    public void setConfigKey(String configKey) {
         this.configKey = configKey;
     }
 
-    public String getHomeKey()
-    {
+    /**
+     * @return the home key
+     */
+    public String getHomeKey() {
         return homeKey;
     }
 
-    public void setHomeKey(String homeKey)
-    {
+    /**
+     * @param homeKey
+     *            the home key to set
+     */
+    public void setHomeKey(String homeKey) {
         this.homeKey = homeKey;
     }
 

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/StartJackrabbitSingleton.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/StartJackrabbitSingleton.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/StartJackrabbitSingleton.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/StartJackrabbitSingleton.java Tue Oct 11 07:38:54 2005
@@ -33,82 +33,85 @@
  * <p>
  * Get a Jackrabbit instance and put it in the <code>Context</code>.<br>
  * This commands maintains a cache with already created instances.<br>
- * if there's no Repository for the given config and home settings a 
- * new instance will be created and cached.
+ * if there's no Repository for the given config and home settings a new
+ * instance will be created and cached.
  * </p>
  */
-public class StartJackrabbitSingleton implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(StartJackrabbitSingleton.class);
-
-	/** cache */
-	private static Map cache = new HashMap();
-
-	/** config file */
-	private String configKey = "config";
-
-	/** home folder */
-	private String homeKey = "home";
-
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		String config = (String) ctx.get(this.configKey);
-		String home = (String) ctx.get(this.homeKey);
-
-		if (log.isDebugEnabled())
-		{
-			log
-					.debug("starting jackrabbit. config=" + config + " home="
-							+ home);
-		}
-
-		try
-		{
-			synchronized (cache)
-			{
-				String key = config + "@" + home;
-				Repository repo = (Repository) cache.get(key);
-				if (repo == null)
-				{
-					String msg = "Starting Jakrabbit instance";
-					log.info(msg);
-					RepositoryConfig conf = RepositoryConfig.create(config,
-							home);
-					repo = RepositoryImpl.create(conf);
-					cache.put(key, repo);
-				}
-				CommandHelper.setRepository(ctx, repo);
-			}
-		} catch (Exception e)
-		{
-			log.error("Unable to start jackrabbit", e) ;
-			throw e;
-		}
-		return false;
-	}
-
-	public String getConfigKey()
-	{
-		return configKey;
-	}
-
-	public void setConfigKey(String configKey)
-	{
-		this.configKey = configKey;
-	}
-
-	public String getHomeKey()
-	{
-		return homeKey;
-	}
-
-	public void setHomeKey(String homeKey)
-	{
-		this.homeKey = homeKey;
-	}
+public class StartJackrabbitSingleton implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(StartJackrabbitSingleton.class);
+
+    /** cache */
+    private static Map cache = new HashMap();
+
+    /** config file */
+    private String configKey = "config";
+
+    /** home folder */
+    private String homeKey = "home";
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String config = (String) ctx.get(this.configKey);
+        String home = (String) ctx.get(this.homeKey);
+
+        if (log.isDebugEnabled()) {
+            log
+                    .debug("starting jackrabbit. config=" + config + " home="
+                            + home);
+        }
+
+        try {
+            synchronized (cache) {
+                String key = config + "@" + home;
+                Repository repo = (Repository) cache.get(key);
+                if (repo == null) {
+                    String msg = "Starting Jakrabbit instance";
+                    log.info(msg);
+                    RepositoryConfig conf = RepositoryConfig.create(config,
+                            home);
+                    repo = RepositoryImpl.create(conf);
+                    cache.put(key, repo);
+                }
+                CommandHelper.setRepository(ctx, repo);
+            }
+        } catch (Exception e) {
+            log.error("Unable to start jackrabbit", e);
+            throw e;
+        }
+        return false;
+    }
+
+    /**
+     * @return the config key
+     */
+    public String getConfigKey() {
+        return configKey;
+    }
+
+    /**
+     * @param configKey
+     *            the config key to set
+     */
+    public void setConfigKey(String configKey) {
+        this.configKey = configKey;
+    }
+
+    /**
+     * @return the home key
+     */
+    public String getHomeKey() {
+        return homeKey;
+    }
+
+    /**
+     * @param homeKey
+     *            the home key to set
+     */
+    public void setHomeKey(String homeKey) {
+        this.homeKey = homeKey;
+    }
 
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/StopJackrabbit.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/StopJackrabbit.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/StopJackrabbit.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/StopJackrabbit.java Tue Oct 11 07:38:54 2005
@@ -26,33 +26,28 @@
 /**
  * Stop Jackrabbit
  */
-public class StopJackrabbit implements Command
-{
+public class StopJackrabbit implements Command {
 
-	/** logger */
-	private static Log log = LogFactory.getLog(StopJackrabbit.class);
+    /** logger */
+    private static Log log = LogFactory.getLog(StopJackrabbit.class);
 
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		if (log.isDebugEnabled())
-		{
-			log.debug("stopping jackrabbit");
-		}
-		RepositoryImpl repo = (RepositoryImpl) CommandHelper.getRepository(ctx);
-		if (repo == null)
-		{
-			throw new IllegalStateException("No current working repository");
-		}
-		if (!(repo instanceof RepositoryImpl))
-		{
-			throw new IllegalStateException(
-					"Jackrabbit is not the current working repository");
-		}
-		repo.shutdown();
-		CommandHelper.setRepository(ctx, null);
-		return false;
-	}
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        if (log.isDebugEnabled()) {
+            log.debug("stopping jackrabbit");
+        }
+        RepositoryImpl repo = (RepositoryImpl) CommandHelper.getRepository(ctx);
+        if (repo == null) {
+            throw new IllegalStateException("No current working repository");
+        }
+        if (!(repo instanceof RepositoryImpl)) {
+            throw new IllegalStateException(
+                    "Jackrabbit is not the current working repository");
+        }
+        repo.shutdown();
+        CommandHelper.setRepository(ctx, null);
+        return false;
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/fs/ExportFileSystem.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/fs/ExportFileSystem.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/fs/ExportFileSystem.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/fs/ExportFileSystem.java Tue Oct 11 07:38:54 2005
@@ -36,176 +36,189 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Exports a node of type nt:file or nt:folder to the given file system path.
+ * Export a <code>Node</code> of type nt:file or nt:folder to the given file
+ * system path.
  */
-public class ExportFileSystem implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(ExportFileSystem.class);
-
-	// ---------------------------- < keys >
-
-	/** Node path key */
-	private String srcJcrPathKey = "srcJcrPath";
-
-	/** File system path key */
-	private String destFsPathKey = "destFsPath";
-
-	/** Overwrite flag key */
-	private String overwriteKey = "overwrite";
-
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		String from = (String) ctx.get(this.srcJcrPathKey);
-		String to = (String) ctx.get(this.destFsPathKey);
-		boolean overwrite = Boolean
-				.valueOf((String) ctx.get(this.overwriteKey)).booleanValue();
-
-		if (log.isDebugEnabled())
-		{
-			log.debug("exporting node at " + from + " to the filesystem (" + to
-					+ ") overwrite=" + overwrite);
-		}
-
-		Node node = CommandHelper.getNode(ctx, from);
-
-		File f = new File(to);
-
-		// check if the file exists
-		if (f.exists() && !overwrite)
-		{
-			throw new CommandException("exception.file.exists", new String[]
-			{ to });
-		}
-
-		// export either a file or a folder
-		if (node.isNodeType("nt:file"))
-		{
-			this.createFile(node, f);
-		} else if (node.isNodeType("nt:folder"))
-		{
-			this.addFolder(node, f);
-		} else
-		{
-			throw new CommandException("exception.not.file.or.folder", new String[]
-			{ node.getPrimaryNodeType().getName() });
-		}
-
-		return false;
-	}
-
-	/**
-	 * Exports a nt:file to the file system
-	 * 
-	 * @param node
-	 * @param file
-	 * @throws IOException
-	 * @throws CommandException
-	 * @throws ValueFormatException
-	 * @throws PathNotFoundException
-	 * @throws RepositoryException
-	 */
-	private void createFile(Node node, File file) throws IOException,
-			CommandException, ValueFormatException, PathNotFoundException,
-			RepositoryException
-	{
-
-		boolean created = file.createNewFile();
-		if (!created)
-		{
-			throw new CommandException("exception.file.not.created", new String[]
-			{ file.getPath() });
-		}
-		BufferedOutputStream out = new BufferedOutputStream(
-				new FileOutputStream(file));
-		InputStream in = node.getNode("jcr:content").getProperty("jcr:data")
-				.getStream();
-
-		int c;
-
-		while ((c = in.read()) != -1)
-		{
-			out.write(c);
-		}
-		in.close();
-		out.flush();
-		out.close();
-	}
-
-	/**
-	 * Exports a nt:folder and all its children to the file system
-	 * 
-	 * @param node
-	 * @param file
-	 * @throws CommandException
-	 * @throws RepositoryException
-	 * @throws IOException
-	 */
-	private void addFolder(Node node, File file) throws CommandException,
-			RepositoryException, IOException
-	{
-		boolean created = file.mkdir();
-
-		if (!created)
-		{
-			throw new CommandException("exception.folder.not.created", new String[]
-			{ file.getPath() });
-		}
-
-		NodeIterator iter = node.getNodes();
-		while (iter.hasNext())
-		{
-			Node child = iter.nextNode();
-			// File
-			if (child.isNodeType("nt:file"))
-			{
-				File childFile = new File(file, child.getName());
-				createFile(child, childFile);
-			} else if (child.isNodeType("nt:folder"))
-			{
-				File childFolder = new File(file, child.getName());
-				addFolder(child, childFolder);
-			}
-		}
-	}
-
-	/**
-	 * @return Returns the overwriteKey.
-	 */
-	public String getOverwriteKey()
-	{
-		return overwriteKey;
-	}
-
-	/**
-	 * @param overwriteKey
-	 *            Set the context attribute key for the overwrite attribute
-	 */
-	public void setOverwriteKey(String overwriteKey)
-	{
-		this.overwriteKey = overwriteKey;
-	}
-
-	public String getSrcJcrPathKey()
-	{
-		return srcJcrPathKey;
-	}
-
-	public void setSrcJcrPathKey(String srcJcrPathKey)
-	{
-		this.srcJcrPathKey = srcJcrPathKey;
-	}
-
-	public String getDestFsPathKey()
-	{
-		return destFsPathKey;
-	}
-
-	public void setDestFsPathKey(String toFsPathKey)
-	{
-		this.destFsPathKey = toFsPathKey;
-	}
+public class ExportFileSystem implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(ExportFileSystem.class);
+
+    // ---------------------------- < keys >
+
+    /** Node path key */
+    private String srcJcrPathKey = "srcJcrPath";
+
+    /** File system path key */
+    private String destFsPathKey = "destFsPath";
+
+    /** Overwrite flag key */
+    private String overwriteKey = "overwrite";
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String from = (String) ctx.get(this.srcJcrPathKey);
+        String to = (String) ctx.get(this.destFsPathKey);
+        boolean overwrite = Boolean
+            .valueOf((String) ctx.get(this.overwriteKey)).booleanValue();
+
+        if (log.isDebugEnabled()) {
+            log.debug("exporting node at " + from + " to the filesystem (" + to
+                    + ") overwrite=" + overwrite);
+        }
+
+        Node node = CommandHelper.getNode(ctx, from);
+
+        File f = new File(to);
+
+        // check if the file exists
+        if (f.exists() && !overwrite) {
+            throw new CommandException("exception.file.exists", new String[] {
+                to
+            });
+        }
+
+        // export either a file or a folder
+        if (node.isNodeType("nt:file")) {
+            this.createFile(node, f);
+        } else if (node.isNodeType("nt:folder")) {
+            this.addFolder(node, f);
+        } else {
+            throw new CommandException("exception.not.file.or.folder",
+                new String[] {
+                    node.getPrimaryNodeType().getName()
+                });
+        }
+
+        return false;
+    }
+
+    /**
+     * Exports an nt:file to the file system
+     * @param node
+     *        the <code>Node</code>
+     * @param file
+     *        the <code>File</code>
+     * @throws IOException
+     *         if an IOException occurs
+     * @throws CommandException
+     *         if the <code>File</code> can't be created
+     * @throws ValueFormatException
+     *         if a <code>Value</code> can't be retrieved
+     * @throws PathNotFoundException
+     *         if the <code>Node</code> can't be found
+     * @throws RepositoryException
+     *         if the current working <code>Repository</code> throws an
+     *         <code>Exception</code>
+     */
+    private void createFile(Node node, File file) throws IOException,
+            CommandException, ValueFormatException, PathNotFoundException,
+            RepositoryException {
+
+        boolean created = file.createNewFile();
+        if (!created) {
+            throw new CommandException("exception.file.not.created",
+                new String[] {
+                    file.getPath()
+                });
+        }
+        BufferedOutputStream out = new BufferedOutputStream(
+            new FileOutputStream(file));
+        InputStream in = node.getNode("jcr:content").getProperty("jcr:data")
+            .getStream();
+
+        int c;
+
+        while ((c = in.read()) != -1) {
+            out.write(c);
+        }
+        in.close();
+        out.flush();
+        out.close();
+    }
+
+    /**
+     * Exports a nt:folder and all its children to the file system
+     * @param node
+     *        the <code>Node</code>
+     * @param file
+     *        <code>File</code>
+     * @throws CommandException
+     *         if the <code>File</code> can't be created
+     * @throws RepositoryException
+     *         if the current working <code>Repository</code> throws an
+     *         <code>Exception</code>
+     * @throws IOException
+     *         if an IOException occurs
+     */
+    private void addFolder(Node node, File file) throws CommandException,
+            RepositoryException, IOException {
+        boolean created = file.mkdir();
+
+        if (!created) {
+            throw new CommandException("exception.folder.not.created",
+                new String[] {
+                    file.getPath()
+                });
+        }
+
+        NodeIterator iter = node.getNodes();
+        while (iter.hasNext()) {
+            Node child = iter.nextNode();
+            // File
+            if (child.isNodeType("nt:file")) {
+                File childFile = new File(file, child.getName());
+                createFile(child, childFile);
+            } else if (child.isNodeType("nt:folder")) {
+                File childFolder = new File(file, child.getName());
+                addFolder(child, childFolder);
+            }
+        }
+    }
+
+    /**
+     * @return the overwrite key
+     */
+    public String getOverwriteKey() {
+        return overwriteKey;
+    }
+
+    /**
+     * @param overwriteKey
+     *        the overwrite key to set
+     */
+    public void setOverwriteKey(String overwriteKey) {
+        this.overwriteKey = overwriteKey;
+    }
+
+    /**
+     * @return the source jcr path key
+     */
+    public String getSrcJcrPathKey() {
+        return srcJcrPathKey;
+    }
+
+    /**
+     * @param srcJcrPathKey
+     *        the source jcr path key to set
+     */
+    public void setSrcJcrPathKey(String srcJcrPathKey) {
+        this.srcJcrPathKey = srcJcrPathKey;
+    }
+
+    /**
+     * @return the destination file system path key
+     */
+    public String getDestFsPathKey() {
+        return destFsPathKey;
+    }
+
+    /**
+     * @param toFsPathKey
+     *        the destination file system path key to set
+     */
+    public void setDestFsPathKey(String toFsPathKey) {
+        this.destFsPathKey = toFsPathKey;
+    }
 }



Mime
View raw message