|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.fckeditor.response.UploadResponse
public class UploadResponse
Simply abstracts from the JavaScript callback to a Java object.
The usage is quite easy but can be tricky since varargs are used in the class
constructor.
The requestor expects a JS method callback with variable
arguments size.
e.g.
window.parent.OnUploadCompleted(101,'some/url/file.img','file.img','no error');
The UploadResponse constructor behaves the same way by simply calling it
with:
UploadResponse ur = new UploadResonse(SC_SOME_ERROR,"/some/url/file.img","file.img","no error"):
| Field Summary | |
|---|---|
static int |
SC_ERROR
Error number ERROR |
static int |
SC_INVALID_EXTENSION
Error number INVALID EXTENSION |
static int |
SC_OK
Error number OK |
static int |
SC_RENAMED
Error number RENAMED |
static int |
SC_SECURITY_ERROR
Error number SECURITY ERROR |
static UploadResponse |
UR_INVALID_CURRENT_FOLDER
UploadResponse INVALID CURRENT FOLDER |
| Constructor Summary | |
|---|---|
UploadResponse(java.lang.Object... arguments)
Constructs the response with variable amount of parameters. |
|
| Method Summary | |
|---|---|
void |
setCustomMessage(java.lang.String customMassage)
Sets the message in the UploadResponse. |
java.lang.String |
toString()
Assembles the JavaScript method for the user callback |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int SC_OK
public static final int SC_ERROR
public static final int SC_RENAMED
public static final int SC_INVALID_EXTENSION
public static final int SC_SECURITY_ERROR
public static final UploadResponse UR_INVALID_CURRENT_FOLDER
| Constructor Detail |
|---|
public UploadResponse(java.lang.Object... arguments)
throws java.lang.IllegalArgumentException
Put the desired parameters in the constructor. You may omit them from
right to left but you have to remain the order.
e.g.
UploadResponse(SC_OK,"/some/url/to/pic.jpg","pic") or
UploadResponse(SC_OK) but not
UploadResponse(SC_OK,"some error message")
Use, if possible, the pre-defined error numbers or upload responses.
If you need to set error number and message only, use constructor with
one parameter and call setCustomMessage(String).
arguments - possible argument order:
int errorNumber, String fileUrl, String filename, String customMessage
java.lang.IllegalArgumentException - if amount of arguments is less than 1 and above 4
java.lang.IllegalArgumentException - if the first argument is not an error number (int)| Method Detail |
|---|
public void setCustomMessage(java.lang.String customMassage)
UploadResponse.
Methods automatically determines how many arguments are set and puts the
message at the end.
customMassage - the message you want to pass to the userpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||