Migrate avatars and group avatars.

This commit is contained in:
Greyson Parrelli
2020-03-26 15:38:27 -04:00
parent 9848599807
commit 10bfc8a753
22 changed files with 317 additions and 136 deletions

View File

@@ -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();
}
}

View File

@@ -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;
}
}
}