88 lines
2.9 KiB
Java
88 lines
2.9 KiB
Java
|
package com.pingan.ai;
|
||
|
|
||
|
import com.pingan.ai.face.utils.PaFaceLogger;
|
||
|
import java.io.File;
|
||
|
import java.io.RandomAccessFile;
|
||
|
|
||
|
/* loaded from: classes3.dex */
|
||
|
public class b<T> {
|
||
|
public static void a(String str, String str2, String str3) {
|
||
|
a(str2, str3);
|
||
|
StringBuilder sb = new StringBuilder();
|
||
|
sb.append(str2);
|
||
|
sb.append(File.separator);
|
||
|
sb.append(str3);
|
||
|
String obj = sb.toString();
|
||
|
StringBuilder sb2 = new StringBuilder();
|
||
|
sb2.append(str);
|
||
|
sb2.append("\r\n");
|
||
|
String obj2 = sb2.toString();
|
||
|
try {
|
||
|
File file = new File(obj);
|
||
|
if (!file.exists()) {
|
||
|
file.getParentFile().mkdirs();
|
||
|
file.createNewFile();
|
||
|
}
|
||
|
RandomAccessFile randomAccessFile = new RandomAccessFile(file, "rwd");
|
||
|
randomAccessFile.seek(file.length());
|
||
|
randomAccessFile.write(obj2.getBytes());
|
||
|
randomAccessFile.close();
|
||
|
} catch (Exception e) {
|
||
|
StringBuilder sb3 = new StringBuilder("writeTxtToFile throws exception: ");
|
||
|
sb3.append(e.getMessage());
|
||
|
PaFaceLogger.i(sb3.toString());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static File a(String str, String str2) {
|
||
|
File file;
|
||
|
a(str);
|
||
|
try {
|
||
|
StringBuilder sb = new StringBuilder();
|
||
|
sb.append(str);
|
||
|
sb.append(File.separator);
|
||
|
sb.append(str2);
|
||
|
file = new File(sb.toString());
|
||
|
try {
|
||
|
if (!file.exists()) {
|
||
|
boolean createNewFile = file.createNewFile();
|
||
|
StringBuilder sb2 = new StringBuilder("makeFilePath, ");
|
||
|
sb2.append(str2);
|
||
|
sb2.append(", success: ");
|
||
|
sb2.append(createNewFile);
|
||
|
PaFaceLogger.i(sb2.toString());
|
||
|
}
|
||
|
} catch (Exception e) {
|
||
|
e = e;
|
||
|
StringBuilder sb3 = new StringBuilder("makeFilePath throws exception: ");
|
||
|
sb3.append(e.getMessage());
|
||
|
PaFaceLogger.i(sb3.toString());
|
||
|
return file;
|
||
|
}
|
||
|
} catch (Exception e2) {
|
||
|
e = e2;
|
||
|
file = null;
|
||
|
}
|
||
|
return file;
|
||
|
}
|
||
|
|
||
|
public static void a(String str) {
|
||
|
try {
|
||
|
File file = new File(str);
|
||
|
if (file.exists()) {
|
||
|
return;
|
||
|
}
|
||
|
boolean mkdir = file.mkdir();
|
||
|
StringBuilder sb = new StringBuilder("makeRootDirectory, ");
|
||
|
sb.append(str);
|
||
|
sb.append(", success: ");
|
||
|
sb.append(mkdir);
|
||
|
PaFaceLogger.i(sb.toString());
|
||
|
} catch (Exception e) {
|
||
|
StringBuilder sb2 = new StringBuilder("makeRootDirectory throws exception: ");
|
||
|
sb2.append(e.getMessage());
|
||
|
PaFaceLogger.i(sb2.toString());
|
||
|
}
|
||
|
}
|
||
|
}
|