mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
Commons: リポジトリに引数なしを追加、ロジック実装
This commit is contained in:
parent
4c958bb333
commit
efb2484569
|
@ -1,4 +1,30 @@
|
||||||
package one.nem.lacerta.data.impl;
|
package one.nem.lacerta.data.impl;
|
||||||
|
|
||||||
public class CommonsImpl {
|
import android.content.Context;
|
||||||
|
|
||||||
|
import java.nio.file.Path;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import dagger.hilt.android.qualifiers.ApplicationContext;
|
||||||
|
import one.nem.lacerta.data.repository.Commons;
|
||||||
|
|
||||||
|
public class CommonsImpl implements Commons{
|
||||||
|
|
||||||
|
private Context applicationContext;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public CommonsImpl(@ApplicationContext Context applicationContext) {
|
||||||
|
this.applicationContext = applicationContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Path getExternalFilesDirPath(String type) {
|
||||||
|
return applicationContext.getExternalFilesDir(type).toPath();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Path getExternalFilesDirPath() {
|
||||||
|
return applicationContext.getExternalFilesDir(null).toPath();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@ import java.nio.file.Path;
|
||||||
|
|
||||||
public interface Commons {
|
public interface Commons {
|
||||||
|
|
||||||
Path getExternalFilesDir(String type);
|
Path getExternalFilesDirPath(String type);
|
||||||
|
|
||||||
|
Path getExternalFilesDirPath();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user