Skip to content
This repository was archived by the owner on Dec 29, 2025. It is now read-only.

Commit 33c0755

Browse files
authored
Update FileUtils.java
1 parent 514d0d0 commit 33c0755

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/main/java/id.my.alvinq.prokitid.libs/FileUtils.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@
33
import java.io.IOException;
44
import java.nio.file.*;
55
import java.nio.file.attribute.BasicFileAttributes;
6+
import android.widget.Toast;
7+
import org.levimc.launcher.util.Logger;
68

79
public class FileUtils {
8-
10+
public static String getStackTraceAsString(Throwable th) {
11+
StringWriter sw = new StringWriter();
12+
PrintWriter pw = new PrintWriter(sw);
13+
th.printStackTrace(pw);
14+
return sw.toString();
15+
}
916
public static void copyFile(String from, String to) {
1017
try {
1118
Files.copy(Paths.get(from), Paths.get(to), StandardCopyOption.REPLACE_EXISTING);
12-
} catch (Exception error) {
19+
} catch (Exception e) {
1320
Throwable real = (e instanceof InvocationTargetException)
1421
? ((InvocationTargetException) e).getCause()
1522
: e;
@@ -40,7 +47,7 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IO
4047
return FileVisitResult.CONTINUE;
4148
}
4249
});
43-
} catch (IOException error) {
50+
} catch (IOException e) {
4451
Throwable real = (e instanceof InvocationTargetException)
4552
? ((InvocationTargetException) e).getCause()
4653
: e;

0 commit comments

Comments
 (0)