File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/main/java/org/codehaus/plexus/util/io Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 2222import java .nio .Buffer ;
2323import java .nio .ByteBuffer ;
2424import java .nio .channels .FileChannel ;
25+ import java .nio .file .Files ;
2526import java .nio .file .Path ;
2627import java .nio .file .StandardOpenOption ;
28+ import java .nio .file .attribute .FileTime ;
29+ import java .time .Instant ;
2730import java .util .Objects ;
2831
2932/**
@@ -154,7 +157,12 @@ public void close() throws IOException
154157 long position = channel .position ();
155158 if ( position != channel .size () )
156159 {
157- modified = true ;
160+ if ( !modified )
161+ {
162+ FileTime now = FileTime .from ( Instant .now () );
163+ Files .setLastModifiedTime ( path , now );
164+ modified = true ;
165+ }
158166 channel .truncate ( position );
159167 }
160168 channel .close ();
You can’t perform that action at this time.
0 commit comments