Skip to content

Commit 882221c

Browse files
Copilotslachiewicz
andcommitted
Address code review: Keep REPLACE_EXISTING as fallback for robustness
Co-authored-by: slachiewicz <[email protected]>
1 parent 9c335b1 commit 882221c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
import org.slf4j.Logger;
3939
import org.slf4j.LoggerFactory;
4040

41+
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
42+
4143
// TODO there should really be constructors which take the source file.
4244

4345
/**
@@ -327,7 +329,7 @@ protected void extractFile(
327329
if (targetFileName.exists()) {
328330
targetFileName.delete();
329331
}
330-
Files.copy(compressedInputStream, targetFileName.toPath());
332+
Files.copy(compressedInputStream, targetFileName.toPath(), REPLACE_EXISTING);
331333
}
332334

333335
targetFileName.setLastModified(entryDate.getTime());

0 commit comments

Comments
 (0)