Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ITS - Intelligent Transport Systems
ITS
Commits
e61c9f07
Commit
e61c9f07
authored
Oct 11, 2016
by
garciay
Browse files
Enhance file rename operation to preserve file extension
parent
5bb77c68
Changes
1
Show whitespace changes
Inline
Side-by-side
tools/pcapdump/src/org/etsi/its/pcapdump/pcapdump.java
View file @
e61c9f07
...
@@ -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
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment