org.cafesip.gwtcomp.server
Class FormResponse

java.lang.Object
  extended by org.cafesip.gwtcomp.server.FormResponse

public class FormResponse
extends Object

Helper class for FileUploadAction. This class that is used by the FileUploadAction action class to indicate to the servlet how to respond to the form request received from a HTTP client.

Author:
Amit Chatterjee

Constructor Summary
FormResponse(int status, String reason)
          A constructor for this class with deletFiles parameter set to false.
FormResponse(int status, String reason, boolean deleteFiles)
          A constructor for this class.
 
Method Summary
 String getReason()
          Returns the reason
 int getStatus()
          Returns the status.
 boolean isDeleteFiles()
          Returns if the temporary files are set to be deleted.
 void setDeleteFiles(boolean deleteFiles)
          Indicates to the servlet whether the temporary files it has created must be deleted.
 void setReason(String reason)
          Sets the reason.
 void setStatus(int status)
          Sets the status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormResponse

public FormResponse(int status,
                    String reason,
                    boolean deleteFiles)
A constructor for this class.

Parameters:
status - status to be sent as the response. They must be valid HTTP status value such as 200, 404, 500, etc.
reason - optional phrase (or reason string). Example: "Not Found".
deleteFiles - true to indicate if the FileUpload servlet must delete the files after invocation of the FileUploadAction.onSubmit() method. If set to true, the FileUploadAction servlet will delete the files that it created from the upload request prior to invoking the FileUploadAction.onSubmit() method.

FormResponse

public FormResponse(int status,
                    String reason)
A constructor for this class with deletFiles parameter set to false.

Parameters:
status -
reason -
Method Detail

getReason

public String getReason()
Returns the reason

Returns:
Returns the reason.

setReason

public void setReason(String reason)
Sets the reason.

Parameters:
reason - The reason to set.

getStatus

public int getStatus()
Returns the status.

Returns:
Returns the status.

setStatus

public void setStatus(int status)
Sets the status.

Parameters:
status - The status to set.

isDeleteFiles

public boolean isDeleteFiles()
Returns if the temporary files are set to be deleted.

Returns:
true if the files are to be deleted.

setDeleteFiles

public void setDeleteFiles(boolean deleteFiles)
Indicates to the servlet whether the temporary files it has created must be deleted.

Parameters:
deleteFiles - true if the files are to be deleted..


Copyright © 2010 Cafesip.org. All Rights Reserved.