net.sf.ooweb.http
Class FormEncodedFile

java.lang.Object
  extended by net.sf.ooweb.http.FormEncodedFile

public class FormEncodedFile
extends java.lang.Object

Represents a file received via a multipart/form-data POST

Author:
Robin Rawson-Tetley

Constructor Summary
FormEncodedFile(java.lang.String name, java.lang.String filename, java.lang.String mimeType, byte[] data)
           
 
Method Summary
 byte[] getData()
           
 java.lang.String getFilename()
           
 java.lang.String getMimeType()
           
 java.lang.String getName()
           
 void saveToFile(java.io.File f)
          Saves the file to disk
 java.lang.String toString()
          returns a simple representation of the file type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormEncodedFile

public FormEncodedFile(java.lang.String name,
                       java.lang.String filename,
                       java.lang.String mimeType,
                       byte[] data)
Parameters:
name -
filename -
mimeType -
data -
Method Detail

getName

public java.lang.String getName()
Returns:
the field name

getFilename

public java.lang.String getFilename()
Returns:
the filename used in the file upload

getMimeType

public java.lang.String getMimeType()
Returns:
the mime type of the file

getData

public byte[] getData()
Returns:
the raw data of the file as a byte[]

saveToFile

public void saveToFile(java.io.File f)
                throws java.io.IOException
Saves the file to disk

Parameters:
f - the File to save
Throws:
java.io.IOException - if the file save fails

toString

public java.lang.String toString()
returns a simple representation of the file type

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright (C) 2005-2007 OOWeb Authors.