use of org.thoughtcrime.securesms.database.NoExternalStorageException in project Signal-Android by signalapp.
the class StorageUtil method getOrCreateBackupDirectory.
public static File getOrCreateBackupDirectory() throws NoExternalStorageException {
File storage = Environment.getExternalStorageDirectory();
if (!storage.canWrite()) {
throw new NoExternalStorageException();
}
File backups = getBackupDirectory();
if (!backups.exists()) {
if (!backups.mkdirs()) {
throw new NoExternalStorageException("Unable to create backup directory...");
}
}
return backups;
}
Aggregations