命名修正

This commit is contained in:
r-ca 2023-12-16 16:17:51 +09:00
parent 42a541e5dc
commit d23e8510db
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
3 changed files with 11 additions and 15 deletions

View File

@ -1,13 +1,11 @@
package one.nem.lacerta.source.jgit;
import org.eclipse.jgit.lib.Repository;
public interface ManageRepo {
public interface JGitRepository {
// リポジトリ取得
Repository getRepository(String id);
org.eclipse.jgit.lib.Repository getRepository(String id);
// リポジトリ作成
Repository createRepository(String id);
org.eclipse.jgit.lib.Repository createRepository(String id);
// リポジトリ削除
void deleteRepository(String id);
// リポジトリ存在確認

View File

@ -1,25 +1,24 @@
package one.nem.lacerta.source.jgit.impl;
import one.nem.lacerta.source.jgit.ManageRepo;
import one.nem.lacerta.source.jgit.JGitRepository;
import javax.inject.Inject;
import one.nem.lacerta.utils.repository.DeviceInfoUtils;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryBuilder;
public class ManageRepoImpl implements ManageRepo {
public class JGitRepositoryImpl implements JGitRepository {
private final DeviceInfoUtils deviceInfoUtils;
@Inject
public ManageRepoImpl(DeviceInfoUtils deviceInfoUtils) {
public JGitRepositoryImpl(DeviceInfoUtils deviceInfoUtils) {
this.deviceInfoUtils = deviceInfoUtils;
}
@Override
public Repository getRepository(String id) {
public org.eclipse.jgit.lib.Repository getRepository(String id) {
RepositoryBuilder repositoryBuilder = new RepositoryBuilder();
repositoryBuilder.setGitDir(deviceInfoUtils.getExternalStorageDirectory().resolve(id).resolve(".git").toFile());
repositoryBuilder.setMustExist(true);
@ -31,7 +30,7 @@ public class ManageRepoImpl implements ManageRepo {
}
@Override
public Repository createRepository(String id) {
public org.eclipse.jgit.lib.Repository createRepository(String id) {
RepositoryBuilder repositoryBuilder = new RepositoryBuilder();
repositoryBuilder.setGitDir(deviceInfoUtils.getExternalStorageDirectory().resolve(id).resolve(".git").toFile());
repositoryBuilder.setMustExist(false);

View File

@ -4,13 +4,12 @@ import dagger.Binds;
import dagger.Module;
import dagger.hilt.InstallIn;
import dagger.hilt.components.SingletonComponent;
import one.nem.lacerta.source.jgit.ManageRepo;
import one.nem.lacerta.source.jgit.impl.ManageRepoImpl;
import one.nem.lacerta.source.jgit.JGitRepository;
@Module
@InstallIn(SingletonComponent.class)
abstract public class ManageRepoModule {
abstract public class JGitRepositoryModule {
@Binds
public abstract ManageRepo bindManageRepo(ManageRepoImpl manageRepoImpl);
public abstract JGitRepository bindManageRepo(one.nem.lacerta.source.jgit.impl.JGitRepositoryImpl manageRepoImpl);
}