public JSONObject processOffice(String srcRealPath, String descRealPath, String taskType, JSONObject jsonObject) {
JSONObject rtnObject = new JSONObject();
String code = "200";
String message = "";
try {
File file = new File(srcRealPath);
if (!file.exists() || !file.canWrite()) {
code = "200";
message = "文件不存在,或已被占用";
rtnObject.element("code", code);
rtnObject.element("message", message);
JSONObject var41 = rtnObject;
return var41;
}
LOGGER.info(srcRealPath + "===>" + descRealPath);
if (file.exists() && file.canWrite()) {
String filename = file.getName();
this.fis = new FileInputStream(file);
this.dos = new DataOutputStream(this.client.getOutputStream());
this.dos.writeUTF(filename);//文件名字
this.dos.flush();
this.dos.writeLong(file.length());//文件长度
this.dos.flush();
String ext = descRealPath.substring(descRealPath.lastIndexOf(".") + 1, descRealPath.length());
this.dos.writeUTF(ext);//源文件后缀名字
this.dos.flush();
this.dos.writeUTF(taskType);//义务类型
this.dos.flush();
if (YOZOOfficeUtil.PROCESS_TYPE_CONVERTFILE.equals(taskType)) {
this.dos.writeUTF(jsonObject.toString());
this.dos.flush();
}
(责任编辑:admin)