com.meterware.httpunit.protocol
Class UploadFileSpec

java.lang.Object
  extended by com.meterware.httpunit.protocol.UploadFileSpec

public class UploadFileSpec
extends java.lang.Object

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

Author:
Russell Gold

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

Constructor Detail

UploadFileSpec

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


UploadFileSpec

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


UploadFileSpec

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

Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Throws:
java.io.IOException

getFileName

public java.lang.String getFileName()

getContentType

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



Copyright © 2011. All Rights Reserved.