Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
tools/pcapdump/src/org/etsi/its/pcapdump/pcapdump.java
tools/pcapdump/src/org/etsi/its/pcapdump/pcapdump.java
+1
-1
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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