Skip to content

Commit

Permalink
refactor: ArchiveDecompressor uses Path
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <marc@marcnuri.com>
  • Loading branch information
manusa committed Dec 20, 2023
1 parent 32b53d2 commit 8222af1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private static void extractArchiveContents(InputStream is, File targetDirectory)
ArchiveEntry entry;
while ((entry = ais.getNextEntry()) != null) {
final File extractTo = new File(targetDirectory, fileName(entry.getName()));
if (extractTo.getCanonicalPath().startsWith(targetDirectory.getCanonicalPath())) {
if (extractTo.getCanonicalFile().toPath().startsWith(targetDirectory.getCanonicalFile().toPath())) {
if (entry.isDirectory()) {
FileUtil.createDirectory(extractTo);
} else {
Expand Down

0 comments on commit 8222af1

Please sign in to comment.