public void setUploadTotalSize(long uploadTotalSize) {
this.uploadTotalSize = uploadTotalSize;
}
public void setUploadAddr(String uploadAddr) {
this.uploadAddr = uploadAddr;
}
public String toJSon() {
StringBu8er strJSon = new StringBu8er();
strJSon.append("{UploadTotalSize:").append(getUploadTotalSize()).appe
nd(
",")
.append("ReadTotalSize:").append(getReadTotalSize()).append(",")
.append("CurrentUploadFileNum:").append(getCurrentUploadFileNum()).
append(",")
.append("SuccessUploadFileCount:").append(
getSuccessUploadFileCount()).append(",")
.append("Status:'").append(getStatus()).append("',")
.append("ProcessStartTime:").append(getProcessStartTime()).
append(",")
.append("ProcessEndTime:").append(getProcessEndTime()).append(
",")
.append("ProcessRunningTime:").append(getProcessRunningTime()).
append(",")
.append("Cancel:").append(getCancel()).append("}");
return strJSon.toString();
}
}
2.1.2. 文件上传状态侦听类(FileUploadListener)
使用 Common-FileUpload 1.2 版本(20070103)。此版本提供了能够监视文件上传情况的
ProcessListener 接口,使开发者通过 FileUploadBase 类对象的 setProcessListener 方法植入自己的
Listener。 FileUploadListener 类实现了 ProcessListener,在整个文件上传过程中,它对上传进度进
行监控,并且根据上传 情况实时的更新上传状态 Bean。源代码如下:
*
*/