net.sf.fikin.ant.httpclientanttask
Class AntMultipartPostMethod.MyParamFile

java.lang.Object
  extended by net.sf.fikin.ant.httpclientanttask.AntMultipartPostMethod.MyParam
      extended by net.sf.fikin.ant.httpclientanttask.AntMultipartPostMethod.MyParamFile
Enclosing class:
AntMultipartPostMethod

public class AntMultipartPostMethod.MyParamFile
extends AntMultipartPostMethod.MyParam

Place a file in the multi-part post request

created on Dec 29, 2006

Since:
Version:
$Revision: 1.3 $
Author:
fiykov

Constructor Summary
AntMultipartPostMethod.MyParamFile()
           
 
Method Summary
 void check()
          check if file has been given
 org.apache.commons.httpclient.methods.multipart.PartBase getPartBase()
          create HttpClient file-part
 void setContentType(java.lang.String contentType)
          set file's content type (mime type)
 void setFile(java.io.File file)
          set file to attach
 
Methods inherited from class net.sf.fikin.ant.httpclientanttask.AntMultipartPostMethod.MyParam
getName, setCharset, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AntMultipartPostMethod.MyParamFile

public AntMultipartPostMethod.MyParamFile()
Method Detail

setFile

public void setFile(java.io.File file)
set file to attach

Parameters:
file - to attach
Ant Task Param Required:
true

setContentType

public void setContentType(java.lang.String contentType)
set file's content type (mime type)

Parameters:
contentType -
Ant Task Param Required:
false

check

public void check()
           throws org.apache.tools.ant.BuildException
check if file has been given

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

getPartBase

public org.apache.commons.httpclient.methods.multipart.PartBase getPartBase()
                                                                     throws java.io.FileNotFoundException
create HttpClient file-part

Specified by:
getPartBase in class AntMultipartPostMethod.MyParam
Returns:
a FilePart object
Throws:
java.io.FileNotFoundException


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