新建文件夹接口
private static final String C_ACTION_NEW_FOLDER = "mswcm_document_library_newfolder";
/**
* 新建文件夹
*/
@RequestMapping(value="/newfolder")
public CIPResponseMsg newfolder(@RequestBody WCM_document_libraryVO vo) {
CIPResponseMsg msg = new CIPResponseMsg();
try {
boolean xAuth = true;
if (xAuth) {
//后端自动创建文件夹序列号
String folder_number = WCM_utils_SequenceUtils.folder_number();
//获取查看文件夹
vo.setFolder_number(folder_number);
//获取查看页面新建文件夹的名称
String folder_name = vo.getFolder_name();
//动态获取页面新建文件夹的名称
File folder = new File("E:\\"+folder_name);
//如果此文件夹不存在
if(!folder.exists()){
//那就创建此文件夹
folder.mkdirs();
}else{
//给提示
System.out.println("文件夹已存在!");
}
msg.errorCode = CIPErrorCode.CALL_SUCCESS.code;
msg.msg = CIPErrorCode.CALL_SUCCESS.name;
} else {
msg.errorCode = CIPErrorCode.ERROR_INVALID_AUTHORIZATION.code;
msg.msg = CIPErrorCode.ERROR_INVALID_AUTHORIZATION.name;
}
} catch (CIPServiceException e) {
CIPErrorCode error = e.getErrorCode();
msg.errorCode = error.code;
msg.msg = error.name;
} catch (CIPDaoException e) {
CIPErrorCode error = e.getErrorCode();
msg.errorCode = error.code;
msg.msg = error.name;
} catch (CIPRuntimeException e) {
CIPErrorCode error = e.getErrorCode();
msg.errorCode = error.code;
msg.msg = error.name;
}
return msg;
}