mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 23:48:00 +01:00
Fix file lock issues with the skin cache
This commit is contained in:
parent
d20199fffb
commit
72324feaf3
1 changed files with 6 additions and 4 deletions
|
@ -193,7 +193,8 @@ public class ThreadDownloadImageETag extends SimpleTexture {
|
|||
Files.createDirectories(cacheFile.getParent());
|
||||
Files.copy(resp.getInputStream(), cacheFile);
|
||||
|
||||
BufferedImage bufferedimage = ImageIO.read(Files.newInputStream(cacheFile));
|
||||
try (InputStream in = Files.newInputStream(cacheFile)) {
|
||||
BufferedImage bufferedimage = ImageIO.read(in);
|
||||
|
||||
// maybe write the etag to disk
|
||||
Header eTag = resp.getResponse().getFirstHeader(HttpHeaders.ETAG);
|
||||
|
@ -206,6 +207,7 @@ public class ThreadDownloadImageETag extends SimpleTexture {
|
|||
}
|
||||
setBufferedImage(bufferedimage);
|
||||
}
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
LOGGER.error("Couldn\'t download http texture", exception);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue