|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opencms.ade.upload.CmsUploadListener
public class CmsUploadListener
Provides the upload listener for the upload widget.
| Field Summary | |
|---|---|
protected long |
m_contentLength
The content length of the request (larger than the sum of file sizes). |
protected java.lang.RuntimeException |
m_exception
Stores the exception if one has been occurred. |
protected boolean |
m_exceptionTrhown
Signals that there occurred an exception before. |
| Constructor Summary | |
|---|---|
CmsUploadListener(int requestSize)
The public constructor for the listener. |
|
| Method Summary | |
|---|---|
void |
cancelUpload(CmsUploadException e)
Sets the exception that should cancel the upload on the next update. |
long |
getBytesRead()
Returns the bytes transfered so far. |
long |
getContentLength()
Returns the content length of the request (larger than the sum of file sizes). |
java.lang.RuntimeException |
getException()
Returns the exception. |
CmsUUID |
getId()
Returns the listeners UUID. |
CmsUploadProgessInfo |
getInfo()
Returns the current progress info of the upload. |
int |
getItem()
Returns the number of the field, which is currently being read. |
long |
getPercent()
Returns the percent done of the current upload. |
boolean |
isCanceled()
Returns true if the process has been canceled due to an error or by the user. |
boolean |
isFinished()
Returns the finished. |
void |
setDelay(int delay)
Sets the delay. |
void |
setFinished(boolean finished)
Sets the finished. |
java.lang.String |
toString()
|
void |
update(long done,
long total,
int item)
Updates the listeners status information and does the following steps: returns if there was already thrown an exception before sets the local variables to the current upload state throws an RuntimeException if it was set in the meanwhile (by another request e.g. user has canceled) slows down the upload process if it's configured stops the watcher if the upload has reached more than 100 percent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected long m_contentLength
protected java.lang.RuntimeException m_exception
protected boolean m_exceptionTrhown
| Constructor Detail |
|---|
public CmsUploadListener(int requestSize)
requestSize - content length of the request (larger than the sum of file sizes)| Method Detail |
|---|
public void cancelUpload(CmsUploadException e)
e - the exceptionpublic long getBytesRead()
public long getContentLength()
public java.lang.RuntimeException getException()
public CmsUUID getId()
public CmsUploadProgessInfo getInfo()
public int getItem()
public long getPercent()
public boolean isCanceled()
true if the process has been canceled due to an error or by the user.
true if the process has been canceled due to an error or by the userpublic boolean isFinished()
public void setDelay(int delay)
delay - the delay to setpublic void setFinished(boolean finished)
finished - the finished to setpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
public void update(long done,
long total,
int item)
update in interface org.apache.commons.fileupload.ProgressListenerProgressListener.update(long, long, int)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||