Skip to content

Commit 6b03a0e

Browse files
committed
[MDEP-651] Add specification table
1 parent e5a465c commit 6b03a0e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java

+8
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,12 @@ else if ( isDirectory )
387387
// Visible for testing
388388
protected boolean shouldExtractEntry( File file, String entryName, Date entryDate ) throws IOException
389389
{
390+
// entryname | entrydate | filename | filedate | behavior
391+
// (1) readme.txt | 1970 | readme.txt | 2020 | never overwrite
392+
// (2) readme.txt | 2020 | readme.txt | 1970 | only overwrite when isOverWrite()
393+
// (3) README.txt | 1970 | readme.txt | 2020 | warn + never overwrite
394+
// (4) README.txt | 2020 | readme.txt | 1970 | warn + only overwrite when isOverWrite()
395+
390396
String canonicalDestPath = file.getCanonicalPath();
391397
boolean fileOnDiskIsNewerThanEntry = ( file.lastModified() >= entryDate.getTime() );
392398
boolean differentCasing = !StringUtils.equalsIgnoreCase( entryName, canonicalDestPath );
@@ -416,6 +422,8 @@ protected boolean shouldExtractEntry( File file, String entryName, Date entryDat
416422
{
417423
getLogger().warn( casingMessage );
418424
}
425+
426+
// (2)
419427
return isOverwrite();
420428
}
421429

0 commit comments

Comments
 (0)