mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 17:53:14 +00:00
命名修正
This commit is contained in:
parent
42a541e5dc
commit
d23e8510db
|
@ -1,13 +1,11 @@
|
||||||
package one.nem.lacerta.source.jgit;
|
package one.nem.lacerta.source.jgit;
|
||||||
|
|
||||||
import org.eclipse.jgit.lib.Repository;
|
public interface JGitRepository {
|
||||||
|
|
||||||
public interface ManageRepo {
|
|
||||||
|
|
||||||
// リポジトリ取得
|
// リポジトリ取得
|
||||||
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);
|
void deleteRepository(String id);
|
||||||
// リポジトリ存在確認
|
// リポジトリ存在確認
|
|
@ -1,25 +1,24 @@
|
||||||
package one.nem.lacerta.source.jgit.impl;
|
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 javax.inject.Inject;
|
||||||
|
|
||||||
import one.nem.lacerta.utils.repository.DeviceInfoUtils;
|
import one.nem.lacerta.utils.repository.DeviceInfoUtils;
|
||||||
|
|
||||||
import org.eclipse.jgit.lib.Repository;
|
|
||||||
import org.eclipse.jgit.lib.RepositoryBuilder;
|
import org.eclipse.jgit.lib.RepositoryBuilder;
|
||||||
|
|
||||||
public class ManageRepoImpl implements ManageRepo {
|
public class JGitRepositoryImpl implements JGitRepository {
|
||||||
|
|
||||||
private final DeviceInfoUtils deviceInfoUtils;
|
private final DeviceInfoUtils deviceInfoUtils;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ManageRepoImpl(DeviceInfoUtils deviceInfoUtils) {
|
public JGitRepositoryImpl(DeviceInfoUtils deviceInfoUtils) {
|
||||||
this.deviceInfoUtils = deviceInfoUtils;
|
this.deviceInfoUtils = deviceInfoUtils;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Repository getRepository(String id) {
|
public org.eclipse.jgit.lib.Repository getRepository(String id) {
|
||||||
RepositoryBuilder repositoryBuilder = new RepositoryBuilder();
|
RepositoryBuilder repositoryBuilder = new RepositoryBuilder();
|
||||||
repositoryBuilder.setGitDir(deviceInfoUtils.getExternalStorageDirectory().resolve(id).resolve(".git").toFile());
|
repositoryBuilder.setGitDir(deviceInfoUtils.getExternalStorageDirectory().resolve(id).resolve(".git").toFile());
|
||||||
repositoryBuilder.setMustExist(true);
|
repositoryBuilder.setMustExist(true);
|
||||||
|
@ -31,7 +30,7 @@ public class ManageRepoImpl implements ManageRepo {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Repository createRepository(String id) {
|
public org.eclipse.jgit.lib.Repository createRepository(String id) {
|
||||||
RepositoryBuilder repositoryBuilder = new RepositoryBuilder();
|
RepositoryBuilder repositoryBuilder = new RepositoryBuilder();
|
||||||
repositoryBuilder.setGitDir(deviceInfoUtils.getExternalStorageDirectory().resolve(id).resolve(".git").toFile());
|
repositoryBuilder.setGitDir(deviceInfoUtils.getExternalStorageDirectory().resolve(id).resolve(".git").toFile());
|
||||||
repositoryBuilder.setMustExist(false);
|
repositoryBuilder.setMustExist(false);
|
|
@ -4,13 +4,12 @@ import dagger.Binds;
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
import dagger.hilt.InstallIn;
|
import dagger.hilt.InstallIn;
|
||||||
import dagger.hilt.components.SingletonComponent;
|
import dagger.hilt.components.SingletonComponent;
|
||||||
import one.nem.lacerta.source.jgit.ManageRepo;
|
import one.nem.lacerta.source.jgit.JGitRepository;
|
||||||
import one.nem.lacerta.source.jgit.impl.ManageRepoImpl;
|
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
@InstallIn(SingletonComponent.class)
|
@InstallIn(SingletonComponent.class)
|
||||||
abstract public class ManageRepoModule {
|
abstract public class JGitRepositoryModule {
|
||||||
|
|
||||||
@Binds
|
@Binds
|
||||||
public abstract ManageRepo bindManageRepo(ManageRepoImpl manageRepoImpl);
|
public abstract JGitRepository bindManageRepo(one.nem.lacerta.source.jgit.impl.JGitRepositoryImpl manageRepoImpl);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user