Commit e61c9f07 authored by garciay's avatar garciay
Browse files

Enhance file rename operation to preserve file extension

parent 5bb77c68
...@@ -71,7 +71,7 @@ public class pcapdump implements ILayer { ...@@ -71,7 +71,7 @@ public class pcapdump implements ILayer {
// Check if the file exist, never remove or scratch files // Check if the file exist, never remove or scratch files
File file = new File(FileName); File file = new File(FileName);
if (file.exists()) { if (file.exists()) {
File newFile = new File(FileName + "_" + System.currentTimeMillis()); File newFile = new File(FileName.replace(".", String.format("_%d.", System.currentTimeMillis())));
file.renameTo(newFile); file.renameTo(newFile);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment