alexandroid/decompiled/jadx/sources/com/bumptech/glide/disklrucache/Util.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

67 lines
2.1 KiB
Java

package com.bumptech.glide.disklrucache;
import androidx.core.os.ParcelCompat$$ExternalSyntheticOutline0;
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.io.Reader;
import java.io.StringWriter;
import java.nio.charset.Charset;
import okio.Buffer$$ExternalSyntheticBUOutline0;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes6.dex */
final class Util {
static final Charset US_ASCII = Charset.forName("US-ASCII");
static final Charset UTF_8 = Charset.forName("UTF-8");
private Util() {
}
public static void closeQuietly(Closeable closeable) {
if (closeable != null) {
try {
closeable.close();
} catch (RuntimeException e) {
throw e;
} catch (Exception unused) {
}
}
}
public static void deleteContents(File file) throws IOException {
File[] listFiles = file.listFiles();
if (listFiles == null) {
Buffer$$ExternalSyntheticBUOutline0.m$2(ParcelCompat$$ExternalSyntheticOutline0.m(file, "not a readable directory: "));
return;
}
for (File file2 : listFiles) {
if (file2.isDirectory()) {
deleteContents(file2);
}
if (!file2.delete()) {
Buffer$$ExternalSyntheticBUOutline0.m$2(ParcelCompat$$ExternalSyntheticOutline0.m(file2, "failed to delete file: "));
return;
}
}
}
public static String readFully(Reader reader) throws IOException {
try {
StringWriter stringWriter = new StringWriter();
char[] cArr = new char[1024];
while (true) {
int read = reader.read(cArr);
if (read == -1) {
String stringWriter2 = stringWriter.toString();
reader.close();
return stringWriter2;
}
stringWriter.write(cArr, 0, read);
}
} catch (Throwable th) {
reader.close();
throw th;
}
}
}