Skip to content

Commit

Permalink
Map extract fix: add replace flag to overwrite bad zips (#12760)
Browse files Browse the repository at this point in the history
If a bad map is downloaded and can't be extracted, it is moved
into the 'bad zips' folder. If the same map is redownloaded,
then we have a failure moving the bad zip because the target
folder already exists.

This is a patch to replace the bad zip if it already exists.
  • Loading branch information
DanVanAtta authored Jul 24, 2024
1 parent 3f0fc30 commit 791b06a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.Collection;
import java.util.Optional;
import java.util.function.Consumer;
Expand Down Expand Up @@ -204,7 +205,7 @@ private Optional<Path> moveBadZip(final Path mapZip) {
}
try {
final Path newLocation = badZipFolder.resolve(mapZip.getFileName());
Files.move(mapZip, newLocation);
Files.move(mapZip, newLocation, StandardCopyOption.REPLACE_EXISTING);
return Optional.of(newLocation);
} catch (final IOException e) {
log.error(
Expand Down

0 comments on commit 791b06a

Please sign in to comment.