|
|
|
|
@ -158,9 +158,13 @@ public class ImageUtils {
|
|
|
|
|
mapParam.put("imageBase64", retStr);
|
|
|
|
|
jsonA.add(mapParam);
|
|
|
|
|
map.put("jsonArray", jsonA.toJSONString());
|
|
|
|
|
String s = HttpClientUtil.doPost(fileUploadUrl, map);
|
|
|
|
|
LogUtil.WriteLog_Info("ImageUtils====附件上传结果显示END=====" + s, "FileController");
|
|
|
|
|
|
|
|
|
|
String[] split = fileUploadUrl.split(",");
|
|
|
|
|
if (split.length > 0) {
|
|
|
|
|
for (String strPath : split) {
|
|
|
|
|
String s = HttpClientUtil.doPost(strPath, map);
|
|
|
|
|
LogUtil.WriteLog_Info("ImageUtils====附件上传结果显示END==" + strPath + "===" + s, "FileController");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return retStr;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
@ -187,13 +191,14 @@ public class ImageUtils {
|
|
|
|
|
return (length % 2 == 0) ? length / 2 : length / 2 + 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static int delFile(String fileName, boolean isXunhuan) {
|
|
|
|
|
public static int delFile(String fileNameParam, boolean isXunhuan) {
|
|
|
|
|
Properties props = System.getProperties();
|
|
|
|
|
String os = props.getProperty("os.name").toLowerCase();
|
|
|
|
|
String fileAddressLocal = "";
|
|
|
|
|
String pathAfter = "";
|
|
|
|
|
if (fileName.contains("/")) {
|
|
|
|
|
String[] split = fileName.split("/");
|
|
|
|
|
String fileName = "";
|
|
|
|
|
if (fileNameParam.contains("/")) {
|
|
|
|
|
String[] split = fileNameParam.split("/");
|
|
|
|
|
if (split.length > 1) {
|
|
|
|
|
pathAfter = split[0];
|
|
|
|
|
fileName = split[1];
|
|
|
|
|
@ -210,9 +215,7 @@ public class ImageUtils {
|
|
|
|
|
} else {
|
|
|
|
|
// fileAddressLocal = PropertiesUtil.getValue("fileAddressLinux");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LogUtil.WriteLog_Info("ImageUtils本地文件地址=====fileAddressLocal====" + fileAddressLocal, "FileController");
|
|
|
|
|
|
|
|
|
|
File file = new File(fileAddressLocal, fileName); // 指定上传位置
|
|
|
|
|
if (file.exists()) {
|
|
|
|
|
file.delete();
|
|
|
|
|
@ -221,10 +224,15 @@ public class ImageUtils {
|
|
|
|
|
String fileDelAddress = PropertiesUtil.getValue("fileDelUrl");
|
|
|
|
|
LogUtil.WriteLog_Info("ImageUtil远程删除文件地址=====fileAddressLocal====" + fileDelAddress, "FileController");
|
|
|
|
|
Map<String, String> map = new HashMap<String, String>();
|
|
|
|
|
map.put("fileName", fileName);
|
|
|
|
|
map.put("fileName", fileNameParam);
|
|
|
|
|
map.put("canDel", "N");
|
|
|
|
|
String s = HttpClientUtil.doPost(fileDelAddress, map);
|
|
|
|
|
LogUtil.WriteLog_Info("ImageUtil远程删除文件地址=====执行结果====" + s, "FileController");
|
|
|
|
|
String[] split = fileDelAddress.split(",");
|
|
|
|
|
if (split.length > 0) {
|
|
|
|
|
for (String strPath : split) {
|
|
|
|
|
String s = HttpClientUtil.doPost(strPath, map);
|
|
|
|
|
LogUtil.WriteLog_Info("ImageUtil远程删除文件地址==" + strPath + "===执行结果====" + s, "FileController");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|