net.sf.fikin.ant.httpclientanttask
Class AntPutMethod

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by net.sf.fikin.ant.httpclientanttask.BaseAntMethod
              extended by net.sf.fikin.ant.httpclientanttask.BaseResponseAntMethod
                  extended by net.sf.fikin.ant.httpclientanttask.AntPutMethod

public class AntPutMethod
extends BaseResponseAntMethod

Perform HTTP PUT method

No multupart body, single body and params are to be mentioned only in the query

Examples:

 
      <httpput url="..." >Put this text in the body</httpput>
 
      <httpput url="..." putFile="..." />
 
 
created on Dec 7, 2006

Since:
Version:
$Revision: 1.4 $
Author:
fiykov
Ant Task Name:
httpput

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.fikin.ant.httpclientanttask.BaseResponseAntMethod
BaseResponseAntMethod.ProjectLogOutputStream, BaseResponseAntMethod.ProjectLogWriter
 
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
AntPutMethod()
           
 
Method Summary
 void addText(java.lang.String t)
          use the text as a body message
protected  void before_execute_method()
          do something before @link #execute_method() is called
protected  void check()
          check that either file or text has been specified
 java.io.File getPutFile()
          get file to put as body
 java.lang.String getText()
          get tag's text
protected  org.apache.commons.httpclient.HttpMethod newHttpMethod(java.lang.String url)
          factory for OPTIONS method
 void setPutFile(java.io.File file)
          file to put in the body message
 
Methods inherited from class net.sf.fikin.ant.httpclientanttask.BaseResponseAntMethod
after_execute_method, closeOutput, getLogAppend, getLogFile, getLogLevel, getLogProcessAs, getOutStream, getOutWriter, initOutputHandler, printBytes, printString, processResponse, setLogAppend, setLogFile, setLogLevel, setLogProcessAs, setOutStream, setOutWriter
 
Methods inherited from class net.sf.fikin.ant.httpclientanttask.BaseAntMethod
addProperty, clearHttpClient, createProxy, createUserCredentials, execute_method, execute, getConnectionTimeout, getCookiePolicy, getFailOnError, getHttpClient, getHttpMethod, getProperties, getProxy, getRetryAttempts, getShutdown, getSslAcceptUntrusted, getUrl, getUserCredentials, setConnectionTimeout, setCookiePolicy, setFailOnError, setHttpMethod, setProperties, setProxy, setRetryAttempts, setShutdown, setSslAcceptUntrusted, setUrl, setUserCredentials
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
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

AntPutMethod

public AntPutMethod()
Method Detail

setPutFile

public void setPutFile(java.io.File file)
file to put in the body message

Parameters:
file - to put as a method body
Ant Task Param Required:
either this or embedded tag text

getPutFile

public java.io.File getPutFile()
get file to put as body

Returns:
file

addText

public void addText(java.lang.String t)
use the text as a body message

Parameters:
t - text to set as method body
Ant Task Param Required:
either this or embedded tag text

getText

public java.lang.String getText()
get tag's text

Returns:
tag's text

newHttpMethod

protected org.apache.commons.httpclient.HttpMethod newHttpMethod(java.lang.String url)
factory for OPTIONS method

Specified by:
newHttpMethod in class BaseAntMethod

check

protected void check()
              throws org.apache.tools.ant.BuildException
check that either file or text has been specified

Overrides:
check in class BaseResponseAntMethod
Throws:
org.apache.tools.ant.BuildException

before_execute_method

protected void before_execute_method()
                              throws org.apache.tools.ant.BuildException,
                                     org.apache.commons.httpclient.HttpException,
                                     java.io.IOException
do something before @link #execute_method() is called

Overrides:
before_execute_method in class BaseAntMethod
Throws:
org.apache.tools.ant.BuildException
org.apache.commons.httpclient.HttpException
java.io.IOException


Copyright © 2003-2007 Nikolay Fiykov. All Rights Reserved.