Skip to content

Commit

Permalink
Bld cache fixes for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gbevin committed Jul 19, 2024
1 parent 8c42052 commit f86b7fb
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main/java/rife/bld/BldCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
import rife.bld.wrapper.Wrapper;
import rife.tools.StringUtils;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
Expand Down Expand Up @@ -120,7 +117,9 @@ private Properties hashProperties() {
var properties = new Properties();
if (getCacheFile().exists()) {
try {
properties.load(new FileInputStream(getCacheFile()));
try (var reader = new BufferedReader(new FileReader(getCacheFile()))) {
properties.load(reader);
}
} catch (IOException e) {
// no-op, we'll store a new properties file when we're writing the cache
}
Expand Down Expand Up @@ -207,7 +206,10 @@ public void writeCache(List<File> extensionsLocalArtifacts) {
}

bldLibDir_.mkdirs();
properties.store(new FileOutputStream(getCacheFile()), null);

try (var writer = new BufferedWriter(new FileWriter(getCacheFile()))) {
properties.store(writer, null);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit f86b7fb

Please sign in to comment.