mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
命名修正
This commit is contained in:
parent
42a541e5dc
commit
d23e8510db
|
@ -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);
|
||||
// リポジトリ存在確認
|
|
@ -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);
|
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user