Rename the file informed in the src attribute, to the name specified in the dst attribute.
1 ftp.rename
<ftp.rename
src='src'
dst='dst'
/>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Asrc | String | Name of the file to remane. | |||
Adst | String | New name of the file. |
Returns | |
---|---|
Type | Description |
Boolean | Returns true if the file has been renamed successfully. |
Exceptions
attribute 'src' required
The name of the file to be renamed has not been specified.
attribute 'dst' required
The new file name has not been indicated.
java.io.FileNotFoundException
There is not file whose name matches the one specified in the src attribute.
Example
Change the name of the file.
Copy
<xsql-script name='ftp_rename_sample1'> <body> <ftp host='192.168.10.1' user='ftpuser' password='ftpdeister'> <println><ftp.nlst /></println> <println><ftp.rename src='camaras' dst='videos' /></println> <println><ftp.nlst /></println> </ftp> </body> </xsql-script>
The file named 'cameras' is renamed to 'videos'.