Compare commits

..

1 Commits

Author SHA1 Message Date
comp500
a368268038 Fix support for symlinked directories 2020-12-07 17:38:21 +00:00

View File

@@ -176,7 +176,10 @@ internal class DownloadTask private constructor(val metadata: IndexFile.File, de
} }
if (fileSource.hashIsEqual(hash)) { if (fileSource.hashIsEqual(hash)) {
Files.createDirectories(destPath.parent) // isDirectory follows symlinks, but createDirectories doesn't
if (Files.isDirectory(destPath.parent)) {
Files.createDirectories(destPath.parent)
}
Files.copy(data.inputStream(), destPath, StandardCopyOption.REPLACE_EXISTING) Files.copy(data.inputStream(), destPath, StandardCopyOption.REPLACE_EXISTING)
data.clear() data.clear()
} else { } else {