Copy and move

Attributes

URI:http://www.xmlpipe.org/xpe/util/filter/copy
Type:filter
Namespace:http://www.xmlpipe.org/xpe/copy
Owner:http://www.xmlpipe.org/xpe

Description

This filter copies or moves files from one directory to another on the server.

Copy


   <cp:copy  from="{from file}"  to="{target file or directory}"  xmlns:cp="http://www.xmlpipe.org/xpe/copy" />

The copy filter lists directories and files in the server. Note:

  • @from, this attributes defines source file to be copied
  • @to, destination file or directory.

Move


   <cp:move  from="{from file}"  to="{target file or directory}"  xmlns:cp="http://www.xmlpipe.org/xpe/copy" />

The move filter lists directories and files in the server. Note:

  • @from, this attributes defines source file to be copied
  • @to, destination file or directory.

Example usage

The following example illustrates how the Copy filter could be used within an XPE pipeline definition (xpipedef.xml) file:


   <register  uri="copy"  xmlns="http://www.xmlpipe.org/xpe/manual" >
      <xpipe  xmlns="" >
         <xnode  type="http://www.xml.org/pipe/xpe/source/http" />
         <xnode  type="xslt/copyfilter" />
         <xnode  type="http://www.xmlpipe.org/xpe/util/filter/copy" />
         <xsink  type="http://www.xml.org/pipe/xpe/sink/http" >
            <property  name="method"  value="xml" />
         </xsink>
      </xpipe>
   </register>

If the XML stream passing through the copy filter encountered the following XML, then the file c:/tmp/f1 to be copied to c:/temp/f2


   <cp:copy  from="file:///c:/tmp/f1"  to="file:///c:/temp/f2"  xmlns:cp="http://www.xmlpipe.org/xpe/copy" />

Similarly if the XML stream passing through the copy filter encountered the following XML, then the file c:/tmp/f2 to be moved to c:/temp/f2


   <cp:move  from="file:///c:/tmp/f2"  to="file:///c:/temp/f2"  xmlns:cp="http://www.xmlpipe.org/xpe/copy" />