diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-02-10 15:02:26 +0100 |
---|---|---|
committer | Kamil Doległo <kamilok1965@interia.pl> | 2020-02-10 15:02:26 +0100 |
commit | 0d0d41f594f1095b4ccc999cffe01a6ef9a22dbb (patch) | |
tree | 32b09319400677750af154034e09d82d4706a396 /core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt | |
parent | 23fbfa0e8e793314cea8d96ac1584d72ec70bb60 (diff) | |
parent | 465ea3d23be40d0d21df7f7cab51ec2d42e3237f (diff) | |
download | dokka-0d0d41f594f1095b4ccc999cffe01a6ef9a22dbb.tar.gz dokka-0d0d41f594f1095b4ccc999cffe01a6ef9a22dbb.tar.bz2 dokka-0d0d41f594f1095b4ccc999cffe01a6ef9a22dbb.zip |
Merge dev-0.10.1 into master
Diffstat (limited to 'core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt')
-rw-r--r-- | core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt b/core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt index 793f9589..bd8b9cf5 100644 --- a/core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt +++ b/core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt @@ -42,7 +42,7 @@ class PackageListProvider @Inject constructor( configuration.cacheRoot == "default" -> Paths.get(System.getProperty("user.home"), ".cache", "dokka") configuration.cacheRoot != null -> Paths.get(configuration.cacheRoot) else -> null - }?.resolve("packageListCache")?.apply { createDirectories() } + }?.resolve("packageListCache")?.apply { toFile().mkdirs() } val cachedProtocols = setOf("http", "https", "ftp") @@ -105,13 +105,13 @@ class PackageListProvider @Inject constructor( val digest = MessageDigest.getInstance("SHA-256") val hash = digest.digest(packageListLink.toByteArray(Charsets.UTF_8)).toHexString() - val cacheEntry = cacheDir.resolve(hash) + val cacheEntry = cacheDir.resolve(hash).toFile() if (cacheEntry.exists()) { try { val connection = packageListUrl.doOpenConnectionToReadContent() val originModifiedDate = connection.date - val cacheDate = cacheEntry.lastModified().toMillis() + val cacheDate = cacheEntry.lastModified() if (originModifiedDate > cacheDate || originModifiedDate == 0L) { if (originModifiedDate == 0L) logger.warn("No date header for $packageListUrl, downloading anyway") |