com.meterware.httpunit
Class UploadFileSpec

java.lang.Object
  |
  +--com.meterware.httpunit.UploadFileSpec

public class UploadFileSpec
extends Object

A description of a file to be uploaded as part of a form submission.

Author:
Russell Gold

Constructor Summary
UploadFileSpec(File file)
          Creates a specification based on a File object.
UploadFileSpec(File file, String contentType)
          Creates a specification based on a File object and with a specified content type.
UploadFileSpec(String fileName, InputStream inputStream, String contentType)
          Creates a specification for an upload from an input stream.
 
Method Summary
 String getContentType()
          Returns the content type associated with this file upload specification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UploadFileSpec

public UploadFileSpec(File file)
Creates a specification based on a File object. The content type will be guessed from the file extension.

UploadFileSpec

public UploadFileSpec(File file,
                      String contentType)
Creates a specification based on a File object and with a specified content type.

UploadFileSpec

public UploadFileSpec(String fileName,
                      InputStream inputStream,
                      String contentType)
Creates a specification for an upload from an input stream. The file name and content type must be specified.
Method Detail

getContentType

public String getContentType()
Returns the content type associated with this file upload specification.