|
25 | 25 | package org.spongepowered.gradle.vanilla.resolver.jdk; |
26 | 26 |
|
27 | 27 | import org.checkerframework.checker.nullness.qual.Nullable; |
| 28 | +import org.slf4j.Logger; |
| 29 | +import org.slf4j.LoggerFactory; |
28 | 30 | import org.spongepowered.gradle.vanilla.internal.resolver.AsyncUtils; |
29 | 31 | import org.spongepowered.gradle.vanilla.internal.resolver.FileUtils; |
30 | 32 | import org.spongepowered.gradle.vanilla.resolver.Downloader; |
|
52 | 54 |
|
53 | 55 | public class JdkHttpClientDownloader implements Downloader { |
54 | 56 | public static final long CACHE_TIMEOUT_SECONDS = 24 /* hours */ * 60 /* minutes/hr */ * 60 /* seconds/min */; // todo: replace with ETag |
55 | | - private static final System.Logger LOGGER = System.getLogger(JdkHttpClientDownloader.class.getName()); |
| 57 | + private static final Logger LOGGER = LoggerFactory.getLogger(JdkHttpClientDownloader.class); |
56 | 58 |
|
57 | 59 | private final Executor asyncExecutor; |
58 | 60 | private final Path baseDirectory; |
@@ -253,15 +255,15 @@ private <T> CompletableFuture<ResolutionResult<T>> downloadValidating( |
253 | 255 | if (algorithm.validate(expectedHash, path)) { |
254 | 256 | return existingHandler.apply(path).thenApply(result -> ResolutionResult.result(result, true)); |
255 | 257 | } else { |
256 | | - JdkHttpClientDownloader.LOGGER.log(System.Logger.Level.WARNING, "Found hash mismatch on file at {}, re-downloading", path); |
| 258 | + JdkHttpClientDownloader.LOGGER.warn("Found hash mismatch on file at {}, re-downloading", path); |
257 | 259 | } |
258 | 260 | } catch (final IOException ex) { |
259 | | - JdkHttpClientDownloader.LOGGER.log(System.Logger.Level.WARNING, "Failed to test hash on file at {}, re-downloading", path); |
| 261 | + JdkHttpClientDownloader.LOGGER.warn("Failed to test hash on file at {}, re-downloading", path); |
260 | 262 | } |
261 | 263 | try { |
262 | 264 | Files.deleteIfExists(path); |
263 | 265 | } catch (final IOException ex) { |
264 | | - JdkHttpClientDownloader.LOGGER.log(System.Logger.Level.WARNING, "Failed to delete file at {}, will try to re-download anyways", path); |
| 266 | + JdkHttpClientDownloader.LOGGER.warn("Failed to delete file at {}, will try to re-download anyways", path); |
265 | 267 | } |
266 | 268 | } |
267 | 269 |
|
@@ -317,7 +319,7 @@ static HttpResponse.BodyHandler<Path> downloading(final Path path) { |
317 | 319 | try { |
318 | 320 | FileUtils.createDirectoriesSymlinkSafe(path.getParent()); |
319 | 321 | } catch (final IOException ex) { |
320 | | - JdkHttpClientDownloader.LOGGER.log(System.Logger.Level.WARNING, "Failed to create directory {} before downloading", path.getParent(), ex); |
| 322 | + JdkHttpClientDownloader.LOGGER.warn("Failed to create directory {} before downloading", path.getParent(), ex); |
321 | 323 | } |
322 | 324 | return HttpResponse.BodyHandlers.ofFile(path); |
323 | 325 | } |
|
0 commit comments