mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2026-11-08 03:47:36 +00:00
namespaces間違えていたので修正
This commit is contained in:
5 files changed
+10
-9
No files matched your search
@@ -0,0 +1,30 @@
|
||||
package one.nem.lacerta.utils.impl;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext;
|
||||
|
||||
import one.nem.lacerta.utils.repository.FileUtils;
|
||||
|
||||
public class FileUtilsImpl implements FileUtils {
|
||||
|
||||
private final Context applicationContext;
|
||||
|
||||
@Inject
|
||||
public FileUtilsImpl(@ApplicationContext Context applicationContext) {
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
public Path getExternalFilesDirPath(String type) {
|
||||
return Objects.requireNonNull(applicationContext.getExternalFilesDir(type)).toPath();
|
||||
}
|
||||
|
||||
public Path getExternalFilesDirPath() {
|
||||
return Objects.requireNonNull(applicationContext.getExternalFilesDir(null)).toPath();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package one.nem.lacerta.utils.module;
|
||||
|
||||
import dagger.Binds;
|
||||
import dagger.Module;
|
||||
import dagger.hilt.InstallIn;
|
||||
import dagger.hilt.components.SingletonComponent;
|
||||
import one.nem.lacerta.utils.repository.FileUtils;
|
||||
import one.nem.lacerta.utils.impl.FileUtilsImpl;
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent.class)
|
||||
abstract public class FileUtilsModule {
|
||||
|
||||
@Binds
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package one.nem.lacerta.utils.repository;
|
||||
|
||||
import java.nio.file.Path;
|
||||
|
||||
public interface FileUtils {
|
||||
|
||||
Path getExternalFilesDirPath(String type);
|
||||
|
||||
Path getExternalFilesDirPath();
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user