LOGGER.info("======== 转换" + ext + "完成,文件大小(" + l / 1048576L + ")M ========");
LOGGER.info("======== 末尾接受" + ext + " ========");
File newFile = new File(descRealPath);
if (newFile.exists()) {
newFile.delete();
}
this.fos = new FileOutputStream(newFile);
progress = 0L;
bytes = new byte[1048576];
while((length = this.dis.read(bytes, 0, bytes.length)) != -1) {
this.fos.write(bytes, 0, length);
this.fos.flush();
}
LOGGER.info("======== 接受" + ext + "文件成功========");
this.dis.close();
} else {
code = "500";
message = "链接被强迫封锁....";
}
} else {
code = "404";
message = "文件不存在,或已被占用:" + srcRealPath;
}
} catch (Exception e) {
code = "500";
message = "客户端报错:" + e.toString();
LOGGER.error("异常:",e);
} finally {
if (this.fis != null) {
try {
this.fis.close();
} catch (Exception var38) {
;
}
}
if (this.fos != null) {
try {
this.fos.close();
} catch (Exception var37) {
;
}
}
try {
this.client.close();
} catch (Exception var36) {
;
}
}
rtnObject.element("code", code);
rtnObject.element("message", message);
return rtnObject;
}
public static void main(String[] args) {
try {
SocketClient socketClient = new SocketClient();
// 将文档转换成pdf文件
(责任编辑:admin)