com.uwyn.rife.engine
Class UploadedFile

java.lang.Object
  extended by com.uwyn.rife.engine.UploadedFile
All Implemented Interfaces:
Cloneable

public class UploadedFile
extends Object
implements Cloneable

An UploadedFile instance is created by the web engine when files are uploaded through a multi-part request.

The uploaded files can be retrieved through the ElementSupport#getUploadedFile method and its siblings. The web engine does its best to dispose of the temporary file at a convenient time, but the file is not guaranteed to persist after the request. If you want to make sure that the file is deleted, you should call File.delete() yourself when you're finished with the uploaded file.

Since:
1.0
Version:
$Revision: 3634 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com)

Constructor Summary
UploadedFile(String filename, String type)
           
 
Method Summary
 UploadedFile clone()
           
protected  void finalize()
           
 File getFile()
          Retrieves the temporary file on the server that was created for the upload.
 String getName()
          Retrieves the name of the file that was selected on the client when uploading.
 String getType()
          Retrieves the content type of the file.
 void setSizeExceeded(boolean exceeded)
           
 void setTempFile(File tempFile)
           
 boolean wasSizeExceeded()
          Indicates whether the uploaded file exceeded the file upload size limit.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UploadedFile

public UploadedFile(String filename,
                    String type)
Method Detail

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

setTempFile

public void setTempFile(File tempFile)

setSizeExceeded

public void setSizeExceeded(boolean exceeded)

getType

public String getType()
Retrieves the content type of the file.

Returns:
the content type of the uploaded file
Since:
1.0

getName

public String getName()
Retrieves the name of the file that was selected on the client when uploading.

Returns:
the name of the original file that was uploaded
Since:
1.0

getFile

public File getFile()
Retrieves the temporary file on the server that was created for the upload.

Returns:
the temporary uploaded file
Since:
1.0

wasSizeExceeded

public boolean wasSizeExceeded()
Indicates whether the uploaded file exceeded the file upload size limit.

If the limit was exceeded, the temporary file will be null and deleted from the server.

Returns:
true if the upload file size limit was exceeded; or

false otherwise

Since:
1.0

clone

public UploadedFile clone()
Overrides:
clone in class Object


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.