|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bowstreet.webapp.util.FileUpload
public class FileUpload
This class has a collection of static methods to allow interaction with the File Upload builder.
Field Summary | |
---|---|
static java.lang.String |
ALLOW_EXCEPTION_RESPONSE
The session key for the allow exception response flag. |
static java.lang.String |
ALLOW_FILE_UPLOAD_TOKEN
The session key for the allow file uploads flag. |
static java.lang.String |
FILE_UPLOAD_SUBPATH
The session key for the file upload destination path. |
static java.lang.String |
ORIGINAL_NAME_PREFIX
The request inputs prefix for the original file name supplied by the client browser. |
static java.lang.String |
ORIGINAL_PATH_PREFIX
The request inputs prefix for the original file path supplied by the client browser. |
static java.lang.String |
OVERWRITE_EXISTING
The session key for the overwrite existing flag. |
Constructor Summary | |
---|---|
FileUpload()
|
Method Summary | |
---|---|
static void |
allowFileUpload(WebAppAccess webAppAccess)
Configures the current user's session to allow files to be uploaded. |
static void |
allowFileUpload(WebAppAccess webAppAccess,
java.lang.String subPath)
Configures the current user's session to allow files to be uploaded. |
static boolean |
getAllowExceptionResponse(javax.servlet.http.HttpServletRequest request)
Returns the setting for the File Upload builder's allow exception response flag. |
static java.lang.String |
getFileUploadSubPath(javax.servlet.http.HttpServletRequest request)
Returns the destination path where uploaded files should be stored. |
static java.lang.String |
getOriginalName(WebAppAccess webAppAccess,
java.lang.String inputName)
Obtains the original file name for the provided form input. |
static java.lang.String |
getOriginalPath(WebAppAccess webAppAccess,
java.lang.String inputName)
Obtains the original client-side file path for the provided form input. |
static boolean |
getOverwriteExisting(javax.servlet.http.HttpServletRequest request)
Returns the setting for the File Upload builder's overwrite existing flag. |
static boolean |
isFileUploadAllowed(javax.servlet.http.HttpServletRequest request)
Check to see if file upload is currently allowed for this request (eg, by the File Upload Builder having put code on the page for the user, which calls the above allowFileUpload for this user.) |
static void |
setAllowExceptionResponse(WebAppAccess webAppAccess,
boolean allow)
Used by MultipartRequest to decide whether to throw exceptions (old) or catch them, execute normal action, and return the Exception in the response. |
static void |
setOverwriteExisting(WebAppAccess webAppAccess,
boolean overwriteExisting)
Used by MultipartRequest to decide whether to overwrite existing files. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ALLOW_EXCEPTION_RESPONSE
public static final java.lang.String ALLOW_FILE_UPLOAD_TOKEN
public static final java.lang.String FILE_UPLOAD_SUBPATH
public static final java.lang.String ORIGINAL_NAME_PREFIX
public static final java.lang.String ORIGINAL_PATH_PREFIX
public static final java.lang.String OVERWRITE_EXISTING
Constructor Detail |
---|
public FileUpload()
Method Detail |
---|
public static void allowFileUpload(WebAppAccess webAppAccess)
webAppAccess
- the current WebAppAccesspublic static void allowFileUpload(WebAppAccess webAppAccess, java.lang.String subPath)
webAppAccess
- the current WebAppAccesssubPath
- the destination path to upload files topublic static boolean getAllowExceptionResponse(javax.servlet.http.HttpServletRequest request)
request
- the current request
public static java.lang.String getFileUploadSubPath(javax.servlet.http.HttpServletRequest request)
request
- the current request
public static java.lang.String getOriginalName(WebAppAccess webAppAccess, java.lang.String inputName)
webAppAccess
- the current WebAppAccessinputName
- the name of the file upload input control on the pagepublic static java.lang.String getOriginalPath(WebAppAccess webAppAccess, java.lang.String inputName)
getOriginalName(com.bowstreet.webapp.WebAppAccess, java.lang.String)
method.
webAppAccess
- the current WebAppAccessinputName
- the name of the file upload input control on the pagepublic static boolean getOverwriteExisting(javax.servlet.http.HttpServletRequest request)
request
- the current request
public static boolean isFileUploadAllowed(javax.servlet.http.HttpServletRequest request)
request
- the current request
public static void setAllowExceptionResponse(WebAppAccess webAppAccess, boolean allow)
webAppAccess
- the current WebAppAccessallow
- flag indicating how exceptions should be handled (true = in response; false = throw)public static void setOverwriteExisting(WebAppAccess webAppAccess, boolean overwriteExisting)
webAppAccess
- the current WebAppAccessoverwriteExisting
- flag indicating if existing files should be overwritten
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |