|
楼主 |
发表于 2018-1-5 09:41:28
|
显示全部楼层
/**
* docs.get(docId); 你应该考虑 docId不再docs里面后返回的doc是null的情况
* lock的时候 已经有别人锁上了 根据返回值来判断是否已经锁上的情况。
* */
if(doc != null){
docName="";
docName = doc.getsDocName();
FilePath="";
FilePath =fParentPath+'/'+ docName;
File outPutFile = new File(FilePath);
doc.download(new FileOutputStream(outPutFile));
zipWidthHeightImageFile(new File(FilePath), new File(FilePath), width,height, 0.7f);
docName="";
docName = doc.getsDocName();
doc = docs.addDoc("defaultDocNameSpace");
FilePath="";
FilePath =fParentPath+'/'+ docName;
File f = new File(FilePath);
doc.upload(f);
docs.createVersion();
FilePath = FilePath.replaceAll("\\\\", "/");
deleteFile(FilePath);//删除文件
String fImageStr = "[{\"docID\":\"" + doc.getsID() + "\",\"docName\":\"" + doc.getsDocName() + "\"," + "\"size\":\"" + doc.getsSize() + "\",\"docPath\":\"" + doc.getsDocPath() + "\","
+ "\"fileID\":\"" + doc.getsFileID() + "\",\"time\":\"" + time + "\"}]";
return fImageStr;
} |
|