Commit 4f75c94b by danmo

活码相关bug修改

1 parent a397a521
...@@ -99,8 +99,8 @@ public class FileUtils extends org.apache.commons.io.FileUtils ...@@ -99,8 +99,8 @@ public class FileUtils extends org.apache.commons.io.FileUtils
if(fileNameCountMap.containsKey(fileName)){ if(fileNameCountMap.containsKey(fileName)){
Integer count = fileNameCountMap.get(fileName); Integer count = fileNameCountMap.get(fileName);
if(count > 0){ if(count > 0){
String tempName = FileUtil.getName(fileName) + "(" + count + ")"; String tempName = FileUtil.getPrefix(fileName) + "(" + count + ")";
fileName = fileName.replaceAll(FileUtil.getName(fileName),tempName); fileName = fileName.replaceAll(FileUtil.getPrefix(fileName),tempName);
} }
fileNameCountMap.put(fileName,count+1); fileNameCountMap.put(fileName,count+1);
} }
...@@ -127,6 +127,13 @@ public class FileUtils extends org.apache.commons.io.FileUtils ...@@ -127,6 +127,13 @@ public class FileUtils extends org.apache.commons.io.FileUtils
} }
public static void main(String[] args) {
String image = "123.img";
String tempName = FileUtil.getPrefix(image) + "(" + 1 + ")";
image = image.replaceAll(FileUtil.getPrefix(image),tempName);
System.out.println(image);
}
/** /**
* *
* @param urlPath 下载路径 * @param urlPath 下载路径
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!