|
There also needs to be some consistency with the Download element. The Download element is a nested (child) element of the SoftwareLoad element. The Download element differs in that it provides attributes (as opposed to nested elements) that declare the item to be downloaded.
Adding another implicit attribute called TargetFileName may also meet the needs here as well Your suggestions are probably the right ones.
An alternative would have been to put the current FileName content into the end of the Source value and instead use FileName as a TargetFileName, so something like this: The problem with that solution is that it breaks backwards compatibility though. Yes, thats exactly the issue, backwards compatibility
The problem here seems to be with the DSL. Here is a declaration from tomcat.groovy
data source: 'https://elastic-grid.s3.amazonaws.com/tomcat/sample.war', data source: 'https://elastic-grid.s3.amazonaws.com/tomcat/sample.war', The target parsing would need to follow these rules: If the target ends with a '/' then the target is considered to be a directory otherwise, the target is considered to be the filename. Would this suit your needs? |
||||||||||||||||||||||||||||||||||||||||||
<Data RemoveOnDestroy="yes" Overwrite="yes" Perms="ugo+rwx">
</Source>
<FileName>foo.xml</FileName>
<Source>http://10.0.1.6:9010/
<Target>/tmp/bar</Target>
</Data>
This declaration will result in the copying of http://10.0.1.6:9010/foo.xml
to /tmp/bar/foo.xml
The nested Target element declares the targeted directory (If the directory name does not begin with a '/', the installRoot directory is a
relative directory, and will be appended to the directory determined by the downloading entity).
One thought is to add an element called TargetFileName that is implicit and defaults to FileName if not provided.