utils: アプリのExternalStorageのパスを取得できるようにした

This commit is contained in:
r-ca 2023-12-14 03:18:51 +09:00
parent 2155edd15f
commit c767f65683
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -3,6 +3,7 @@ package one.nem.lacerta.utils.impl;
import android.content.Context; import android.content.Context;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.Objects;
import javax.inject.Inject; import javax.inject.Inject;
@ -19,17 +20,19 @@ public class DeviceInfoUtilsImpl implements DeviceInfoUtils {
@Override @Override
public Path getExternalStorageDirectory() { public Path getExternalStorageDirectory() {
return // TODO-rca: 結果がnullだった場合の処理を追加する
return Objects.requireNonNull(applicationContext.getExternalFilesDir(null)).toPath();
} }
@Override @Override
public Path getExternalStorageDirectory(String type) { public Path getExternalStorageDirectory(String type) {
return null; // TODO-rca: 結果がnullだった場合の処理を追加する
return Objects.requireNonNull(applicationContext.getExternalFilesDir(type)).toPath();
} }
@Override @Override
public boolean hasPermission(String permission) { public boolean hasPermission(String permission) {
return false; return null
} }
@Override @Override