| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>Ant-contrib Tasks: URLEncode</title> |
| 5 | </head> |
| 6 | |
| 7 | <body> |
| 8 | <h1>Foreach</h1> |
| 9 | |
| 10 | <p>The URLEncode task will encode a given property for use within a |
| 11 | a URL string. This value which is actually set will be encoded |
| 12 | via the <code>java.net.URLEncoder.encode()</code> method. |
| 13 | Typically, you must do this for all parameter values within a URL.</p> |
| 14 | |
| 15 | <h2>Parameters</h2> |
| 16 | <table border="1" cellpadding="2" cellspacing="0"> |
| 17 | <tr> |
| 18 | <th>Attribute</th> |
| 19 | <th>Description</th> |
| 20 | <th>Required</th> |
| 21 | </tr> |
| 22 | <tr> |
| 23 | <td valign="top">property</td> |
| 24 | <td valign="top">The name of the property to set.</td> |
| 25 | <td align="center" valign="top">Yes.</td> |
| 26 | </tr> |
| 27 | <tr> |
| 28 | <td valign="top">override</td> |
| 29 | <td valign="top">If the property is already set, should we change it's value. |
| 30 | Can be <code>true</code> or <code>false</code></td> |
| 31 | <td align="center" valign="top">No. Defaults to <code>false</code></td> |
| 32 | </tr> |
| 33 | <tr> |
| 34 | <td valign="top">name <i>Deprecated</i></td> |
| 35 | <td valign="top">The name of the property to set.</td> |
| 36 | <td align="center" valign="top">No. Use the <code>property</code> attribute |
| 37 | instead</td> |
| 38 | </tr> |
| 39 | <tr> |
| 40 | <td valign="top">value</td> |
| 41 | <td valign="top">The value of the property.</td> |
| 42 | <td align="center" valign="top">No, if refid or location is specified</td> |
| 43 | </tr> |
| 44 | <tr> |
| 45 | <td valign="top">location</td> |
| 46 | <td valign="top">The location of a file whose absolute path will be the value |
| 47 | of the property.</td> |
| 48 | <td align="center" valign="top">No, if value or refid is specified.</td> |
| 49 | </tr> |
| 50 | <tr> |
| 51 | <td valign="top">refid</td> |
| 52 | <td valign="top">The id of a saved reference whose value will be the value |
| 53 | of the property.</td> |
| 54 | <td align="center" valign="top">No, defaults to ",".</td> |
| 55 | </tr> |
| 56 | </table> |
| 57 | |
| 58 | |
| 59 | <h2>Example</h2> |
| 60 | |
| 61 | |
| 62 | The following code |
| 63 | |
| 64 | <pre> |
| 65 | <code> |
| 66 | <urlencode name="file.location" location="C:\\wwwhome\\my reports\\report.xml" /> |
| 67 | </code> |
| 68 | </pre> |
| 69 | |
| 70 | would set the "file.location" property to the value: <code> C%3A%5Cwwwhome%5Cmy+reports%5Creport.xml</code> |
| 71 | which could then be used in a URL. |
| 72 | |
| 73 | <hr> |
| 74 | <p align="center">Copyright © 2002-2003 Ant-Contrib Project. All |
| 75 | rights Reserved.</p> |
| 76 | |
| 77 | </body> |
| 78 | </html> |