org.inria.ns.reflex.modules.io
Class CopyAction

java.lang.Object
  extended by org.inria.ns.reflex.processor.core.AbstractAction
      extended by org.inria.ns.reflex.modules.io.CopyAction
All Implemented Interfaces:
Executable, Presentable, NamespaceContextFactory

public class CopyAction
extends AbstractAction

At runtime, the <io:copy> element, copies the file, directory, or input specified by the source attribute, in the file, directory or output specified by the dest attribute.

<io:copy source="{ expression }" target="newFile"
 xmlns:io="http://ns.inria.org/active-tags/io"/>

Author:
Philippe Poulard

Nested Class Summary
 
Nested classes/interfaces inherited from class org.inria.ns.reflex.processor.core.AbstractAction
AbstractAction.ParameterAdapter, AbstractAction.UselessAction
 
Field Summary
 
Fields inherited from class org.inria.ns.reflex.processor.core.AbstractAction
actions, parent, processorInstance
 
Constructor Summary
CopyAction(Expression source, Expression target, Expression filter, Node node, AbstractAction parent)
          Creates a new instance of CopyAction.
 
Method Summary
 void runAction(DataSet dataSet)
          Execute the action by copying the file(s).
static AbstractAction unmarshal(AbstractAction parent, Element element)
          XML unmarshaller for CopyAction.
 
Methods inherited from class org.inria.ns.reflex.processor.core.AbstractAction
addAction, addFallbackAction, createContext, getCanonicalPath, getFallbackAction, getLocalFallbackAction, getLogger, getNamespaceContext, getNode, getParent, recover, recover, removeFallbackAction, reorganize, run, runActions, toPrettyString, toPrettyString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CopyAction

public CopyAction(Expression source,
                  Expression target,
                  Expression filter,
                  Node node,
                  AbstractAction parent)
Creates a new instance of CopyAction.

Parameters:
source - The file or directory to copy.
target - The directory in which copy the file.
filter - The filter to use when copying.
node - The node from which the action has been unmarshalled. Used for namespace prefix resolution when performing XPath expressions.
parent - The action depending from.
Method Detail

unmarshal

public static AbstractAction unmarshal(AbstractAction parent,
                                       Element element)
                                throws XMLException
XML unmarshaller for CopyAction.

Parameters:
parent - The action depending from.
element - The XML element to unmarshall.
Returns:
The CopyAction created.
Throws:
UnmarshalException - When the element and its content is not those expected.
XMLException

runAction

public void runAction(DataSet dataSet)
               throws ExecutionException,
                      XPathException
Execute the action by copying the file(s).

Overrides:
runAction in class AbstractAction
Parameters:
dataSet - The set of data used when the action is running.
Throws:
ExecutionException - If the action can't be performed.
XPathException