|
EchoPoint API - 3.0.0b5 App Webcontainer |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectechopoint.tucana.event.UploadCallbackAdapter
echopoint.tucana.event.DefaultUploadCallback
public class DefaultUploadCallback
A default implementation of an UploadCallback that saves the
uploaded file(s) to a specified directory.
Note: Development of this component was sponsored by TCN Broadcasting. We are grateful for their support and sponsorship.
| Field Summary | |
|---|---|
protected static String |
FILE_SEPARATOR
The file separator character to use. |
protected static String |
TEMP_DIR
The system default temporary directory. |
| Fields inherited from class echopoint.tucana.event.UploadCallbackAdapter |
|---|
event, level, logger, uploadIndex |
| Constructor Summary | |
|---|---|
protected |
DefaultUploadCallback()
Default constructor to allow sub-classing. |
|
DefaultUploadCallback(File directory)
Create a new callback handler that saves files to the specified directory. |
| Method Summary | |
|---|---|
File |
getDirectory()
Accessor for property 'directory'. |
protected File |
getFileName(String name)
Return a file object that represents the uploaded file that is to be saved. |
protected File |
getTempFile()
Return a temporary file to which the contents of the uploaded file will be initially written. |
void |
setDirectory(File directory)
Mutator for property 'directory'. |
void |
uploadSucceeded(UploadFinishEvent event)
Over-ridden to save the contents of the uploaded file to directory. |
| Methods inherited from class echopoint.tucana.event.UploadCallbackAdapter |
|---|
getEvent, getLevel, setLevel, uploadCancelled, uploadDisallowed, uploadFailed, uploadProgressed, uploadStarted |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String FILE_SEPARATOR
protected static final String TEMP_DIR
| Constructor Detail |
|---|
protected DefaultUploadCallback()
public DefaultUploadCallback(File directory)
throws IllegalArgumentException
directory - The directory to which files are to be saved.
IllegalArgumentException - If the file specified is not a directory.| Method Detail |
|---|
public void uploadSucceeded(UploadFinishEvent event)
directory.
Client-code should ideally wrap this method in a try-catch clause to
handle file copying errors and update the UI as appropriate.
Call back method invoked once an upload event completes.
uploadSucceeded in interface UploadCallbackuploadSucceeded in class UploadCallbackAdapterevent - The event that has completed.
RuntimeException - If errors are encountered while copying the
uploaded file to the specified directory.protected File getFileName(String name)
name - The file name of the uploaded file.
protected File getTempFile()
public File getDirectory()
public void setDirectory(File directory)
throws IllegalArgumentException
directory - Value to set for property 'directory'.
IllegalArgumentException - If the file specified is not a directory.
|
EchoPoint API - 3.0.0b5 App Webcontainer |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||