|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.fckeditor.response.UploadResponse
public class UploadResponse
Represents the HTML/JS response for the File Browser POST
requests.
This class utilizes varags to reflect the JavaScript callback function in an optimal way. However, varargs can be tricky. You can always omit passed parameters from right to left but any violation may result in an exception or a failed callback.
For example: window.parent.OnUploadCompleted(101,'some/url/file.img','file.img','no error')
can be mapped with
UploadResponse ur = new UploadResponse(SC_SOME_ERROR,"/some/url/file.img","file.img","no error")
.
But window.parent.OnUploadCompleted(101,'some/url/file.img','no error')
is an illegal callback and
will fail.
Field Summary | |
---|---|
static int |
EN_CUSTOM_ERROR
Error number CUSTOM ERROR |
static int |
EN_CUSTOM_WARNING
Error number CUSTOM WARNING |
static int |
EN_FILE_RENAMED_WARNING
Error number FILE RENAMED WARNING |
static int |
EN_INVALID_FILE_TYPE_ERROR
Error number INVALID FILE TYPE |
static int |
EN_OK
Error number OK |
static int |
EN_SECURITY_ERROR
Error number SECURITY ERROR |
protected Object[] |
parameters
JavaScript callback parameters |
Constructor Summary | |
---|---|
UploadResponse(Object... arguments)
Constructs a response with a varying amount of arguments. |
Method Summary | |
---|---|
static UploadResponse |
getFileRenamedWarning(String fileUrl,
String newFileName)
Creates a FILE RENAMED warning. |
static UploadResponse |
getFileUploadDisabledError()
Creates a FILE UPLOAD DISABLED error. |
static UploadResponse |
getFileUploadWriteError()
Creates a FILE UPLOAD WRITE error. |
static UploadResponse |
getInvalidCommandError()
Creates a INVALID COMMAND error. |
static UploadResponse |
getInvalidCurrentFolderError()
Creates a INVALID CURRENT FOLDER error. |
static UploadResponse |
getInvalidFileTypeError()
Creates a INVALID FILE TYPE error. |
static UploadResponse |
getInvalidResourceTypeError()
Creates a INVALID RESOURCE TYPE error. |
static UploadResponse |
getOK(String fileUrl)
Creates an OK response. |
void |
setCustomMessage(String customMassage)
Sets the custom message of this upload response. |
String |
toString()
Creates the HTML/JS representation of this upload response. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Object[] parameters
public static final int EN_OK
public static final int EN_CUSTOM_ERROR
public static final int EN_CUSTOM_WARNING
public static final int EN_FILE_RENAMED_WARNING
public static final int EN_INVALID_FILE_TYPE_ERROR
public static final int EN_SECURITY_ERROR
Constructor Detail |
---|
public UploadResponse(Object... arguments)
Use the predefined error numbers or upload responses, if possible. If you
need to set error number and message only, use this constructor with the
first argument only and call
setCustomMessage(String)
.
arguments
- possible argument order:
int errorNumber, String fileUrl, String filename, String customMessage
. Omit from right to left.
IllegalArgumentException
- if amount of arguments is less than 1 and above 4
IllegalArgumentException
- if the first argument is not an error number (int)Method Detail |
---|
public void setCustomMessage(String customMassage)
customMassage
- the custom message of this upload responsepublic static UploadResponse getOK(String fileUrl)
OK
response.
public static UploadResponse getFileRenamedWarning(String fileUrl, String newFileName)
FILE RENAMED
warning.
public static UploadResponse getInvalidFileTypeError()
INVALID FILE TYPE
error.
public static UploadResponse getInvalidCommandError()
INVALID COMMAND
error.
public static UploadResponse getInvalidResourceTypeError()
INVALID RESOURCE TYPE
error.
public static UploadResponse getInvalidCurrentFolderError()
INVALID CURRENT FOLDER
error.
public static UploadResponse getFileUploadDisabledError()
FILE UPLOAD DISABLED
error.
public static UploadResponse getFileUploadWriteError()
FILE UPLOAD WRITE
error.
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |