if(rc != 200) {
log.info("上传出错啦!! "+ sb.toString() + "" + ebo.getPath());
return;
}
//---------------------------------------------------------------------------
EverboxUploadInfo uploadInfo = Json.fromJson(EverboxUploadInfo.class, sb);
if(uploadInfo.getRequired() != null && uploadInfo.getRequired().size() > 0) {
log.infof("需要上传%d段",uploadInfo.getRequired().size());
RandomAccessFile raf = new RandomAccessFile(f, "r");
List<EverboxUploadInfo> infos = uploadInfo.getRequired();
long lastPartsize = f.length() - (part-1)*Constants.FILE_CHUNK_SIZE;
for (int i = 0; i < infos.size(); i++) {
EverboxUploadInfo info = infos.get(i);
log.infof("开始上传第%d段",info.getIndex());
raf.seek(info.getIndex() * Constants.FILE_CHUNK_SIZE);
sb = new StringBuilder();
EverBoxJsonProxy ebjp = new EverBoxJsonProxy();
if(info.getIndex() + 1 < part) {
rc = ebjp.CallPostFileStream(info.getUrl(), raf, Constants.FILE_CHUNK_SIZE, sb, new UploadProgressListener());
} else {
rc = ebjp.CallPostFileStream(info.getUrl(), raf, (int)lastPartsize, sb, new UploadProgressListener());
}
if(rc != 200) {
log.info("上传出错啦!! "+ sb.toString() + " " + ebo.getPath());
return;