mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 00:59:49 +01:00
Migrate avatars and group avatars.
This commit is contained in:
@@ -49,13 +49,13 @@ public final class FileUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void deleteDirectory(@Nullable File directory) {
|
||||
public static boolean deleteDirectory(@Nullable File directory) {
|
||||
if (directory == null || !directory.exists() || !directory.isDirectory()) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
deleteDirectoryContents(directory);
|
||||
|
||||
directory.delete();
|
||||
return directory.delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +224,9 @@ public class Util {
|
||||
}
|
||||
}
|
||||
|
||||
public static void close(Closeable closeable) {
|
||||
public static void close(@Nullable Closeable closeable) {
|
||||
if (closeable == null) return;
|
||||
|
||||
try {
|
||||
closeable.close();
|
||||
} catch (IOException e) {
|
||||
@@ -607,4 +609,12 @@ public class Util {
|
||||
return concat;
|
||||
}
|
||||
|
||||
public static boolean isLong(String value) {
|
||||
try {
|
||||
Long.parseLong(value);
|
||||
return true;
|
||||
} catch (NumberFormatException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user