copy
¶
The copy
task uploads a file or a set of files to a DataPower device from a local file system. copy
is capable of uploading multiple files at once.
copy
also creates a directory structure containing the files similar to the standard Ant copy task. copy
automatically creates necessary directories on the device to reproduce the local directory tree.
copy
relies on the nested dpFileset
element(s) to determine which files and directories to create and upload.
Attributes/Options¶
Name | Description | Required |
---|---|---|
toDir | Specifies the target directory for uploaded files on the device. It could include a filesystem which is defined using You can override |
No |
cleanDirectories | If Defaults to |
No |
flatten | If Defaults to |
No |
flushCache | If set to Defaults to |
No |
transformOnly | If set to This is convenient for developing/troubleshooting Defaults to |
No |
dir | The root of the local directory tree that will be copied to DataPower. DPBuddy implicitly creates a nested fileset using this directory and includes or excludes patterns if provided. |
No |
includes | Comma- or space-separated list of patterns of files that must be included in Ant pattern format. Defaults to “**” (all files are included when omitted). |
No |
excludes | Comma- or space-separated list of patterns of files that must be excludes in Ant pattern format. Defaults to ‘none’ (no files, except default Ant excludes, are excluded when omitted.) |
No |
rollbackOnError | If set to Defaults to |
No |
domainPatterns
CLI alias: domains
|
Comma-delimited list of regular expression patterns defining what domains to apply the command to. Use ‘.*’ for all domains except the default. Use ‘.*,default’ to include the default domain. Defaults to the current domain. The current domain is specified using the |
No |
dpFileset
Nested Element¶
dpFileset
defines what files on the local file system will be uploaded to the device. dpFileset
supports all attributes and nested elements of the regular Ant fileset. In addition, you can specify the toDir
attribute, which defines the root directory (and, optionally, the file system) on the device.
dpFileset
also supports nested transform
element explained in the next section.
If toDir
at the fileset and task levels are omitted, DPBuddy will use the local:/
filesystem and the base directory of the fileset (the directory specified by the dir
attribute of the fileset) as the root on the device.
If flatten
is set to true
, DPBuddy will upload all files into the root directory.
You can specify multiple dpFileset
elements within the same task.
Name | Description | Required |
---|---|---|
toDir | Specifies the target directory for uploaded files on the device. It could include a filesystem which is defined using the You can specify default |
No |
matchRequired | If set to Defaults to |
No |
transform
Nested Element¶
transform
contains transformation actions documented in Using DPBuddy to Transform DataPower Configuration and XML Files. This element is optional. It must be nested within the dpFileset
element.
These transformation actions apply to all matching files. Use multiple dpFileset
elements if the transformations should only be applied to a subset of the files being copied.
Note that transformation actions can be applied only to XML files. All non-XML files should be specified in a separate dpFileset
which does not have any transformations.
Examples¶
Suppose there is a local directory services/person/wsdl
containing some wsdl and xsd files. The following command will create local:/apps/services/person/wsdl
directory tree on the device and upload the files. Since cleanDirectories
is set to true
, it will delete the directory local:/apps/services
before uploading the files.
dpbuddy copy -toDir "/apps/services" -includes "**/*.wsdl **/*.xsd" -cleanDirectories
<dp:copy cleanDirectories="true">
<dpFileset toDir="/apps/services"
dir="services" includes="**/*.wsdl **/*.xsd"/>
</dp:copy>
You can find more examples under samples
in your distribution or online.