Skip to content

Commit 2763acc

Browse files
Fix messed okhttp cache folder
1 parent 31e253f commit 2763acc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/java/org/maxgamer/quickshop/util/HttpUtil.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,18 @@ public class HttpUtil {
3737
protected static final com.google.common.cache.Cache<String, String> requestCachePool = CacheBuilder.newBuilder()
3838
.expireAfterWrite(7, TimeUnit.DAYS)
3939
.build();
40-
private static final File cacheFolder = Util.getCacheFolder();
40+
private static final File cacheFolder = getCacheFolder();
4141
private static OkHttpClient client = new OkHttpClient.Builder().cache(new Cache(cacheFolder, 50L * 1024L * 1024L)).build();
4242

4343
private static volatile boolean shutdown = false;
4444

45+
@NotNull
46+
private static File getCacheFolder() {
47+
File file = new File(Util.getCacheFolder(), "okhttp_tmp");
48+
file.mkdirs();
49+
return file;
50+
}
51+
4552
@Deprecated
4653
public static HttpUtil create() {
4754
return new HttpUtil();

0 commit comments

Comments
 (0)