|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.ProjectComponent | +--org.apache.tools.ant.Task | +--net.sf.antcontrib.net.PostTask
This task does an http post. Name/value pairs for the post can be set in either or both of two ways, by nested Prop elements and/or by a file containing properties. Nested Prop elements are automatically configured by Ant. Properties from a file are configured by code borrowed from Property so all Ant property constructs (like ${somename}) are resolved prior to the post. This means that a file can be set up in advance of running the build and the appropriate property values will be filled in at run time.
Developed for use with Antelope, migrated to ant-contrib Oct 2003.
Field Summary |
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
PostTask()
|
Method Summary | |
void |
addConfiguredProp(Prop p)
Adds a name/value pair to post. |
void |
addText(java.lang.String text)
Adds a feature to the Text attribute of the PostTask object |
java.lang.String |
decode(java.lang.String toDecode)
|
java.lang.String |
encode(java.lang.String toEncode)
|
void |
execute()
Do the post. |
java.lang.String |
invokeCoder(java.lang.String methodName,
java.lang.String toEncode)
|
void |
setAppend(boolean b)
Should the log file be appended to or overwritten? Default is true, append to the file. |
void |
setEncoding(java.lang.String encoding)
Sets the encoding of the outgoing properties, default is UTF-8. |
void |
setFailonerror(boolean fail)
Should the build fail if the post fails? |
void |
setFile(java.io.File f)
Set the name of a file to read a set of properties from. |
void |
setLogfile(java.io.File f)
Set the name of a file to save the response to. |
void |
setMaxwait(int wait)
How long to wait on the remote server. |
void |
setTo(java.net.URL name)
Set the url to post to. |
void |
setVerbose(boolean b)
If true, progress messages and returned data from the post will be displayed. |
void |
setWantresponse(boolean b)
Default is true, get the response from the post. |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorFlush, handleErrorOutput, handleFlush, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, setProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PostTask()
Method Detail |
public void setTo(java.net.URL name)
name
- the url to post to.public void setFile(java.io.File f)
f
- the filepublic void setLogfile(java.io.File f)
f
- the filepublic void setAppend(boolean b)
b
- append or notpublic void setVerbose(boolean b)
b
- true = verbosepublic void setWantresponse(boolean b)
b
- print/log server responsepublic void setEncoding(java.lang.String encoding)
encoding
- The new encoding valuepublic void setMaxwait(int wait)
The default wait period is 3 minutes (180 seconds).
wait
- time to wait in seconds, set to 0 to wait forever.public void setFailonerror(boolean fail)
fail
- true = fail the build, default is falsepublic void addConfiguredProp(Prop p) throws org.apache.tools.ant.BuildException
p
- A property pair to send as part of the post.
org.apache.tools.ant.BuildException
- When name and/or value are missing.public void addText(java.lang.String text)
text
- The feature to be added to the Text attributepublic void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
- On any error.public java.lang.String encode(java.lang.String toEncode) throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
public java.lang.String decode(java.lang.String toDecode) throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
public java.lang.String invokeCoder(java.lang.String methodName, java.lang.String toEncode)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |