mmhttp.protocol
Class UploadedFile

java.lang.Object
  extended by mmhttp.protocol.UploadedFile

public class UploadedFile
extends java.lang.Object

When parsing a request that contains uploaded files, the file data will be bundled up in instance of this class. The actual file content is stored in a temporary file.


Constructor Summary
UploadedFile(java.lang.String name, java.lang.String type, java.io.File file)
           
 
Method Summary
 void delete()
          Deletes the temp file containing the uploaded file content.
 java.io.File getFile()
           
 java.lang.String getName()
           
 java.lang.String getType()
           
 boolean isUsable()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UploadedFile

public UploadedFile(java.lang.String name,
                    java.lang.String type,
                    java.io.File file)
Parameters:
name -
type -
file -
Method Detail

getName

public java.lang.String getName()
Returns:
the file's name

getType

public java.lang.String getType()
Returns:
the files type

getFile

public java.io.File getFile()
Returns:
the File, which points to the temp file where the content is stored.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a human readable representation of the object.

isUsable

public boolean isUsable()
Returns:
true if the file has a valid name.

delete

public void delete()
Deletes the temp file containing the uploaded file content.



Copyright © 2009 Micah Martin. All Rights Reserved.