Class GitFileServiceImpl
- java.lang.Object
-
- com.arms.egovframework.javaservice.gcframework.service.GitFileServiceImpl
-
- All Implemented Interfaces:
GitFileService
@Service public class GitFileServiceImpl extends java.lang.Object implements GitFileService
GitFileService 인터페이스의 구현체. Git Repository와 통신하여 파일 관리 및 파싱을 수행합니다.
-
-
Constructor Summary
Constructors Constructor Description GitFileServiceImpl(GiteaUserConfig giteaUserConfig, java.util.List<GitRepositoryProvider> providers, java.util.List<AbstractContentParser<?>> parsers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandeleteFile(RepoType repoType, java.lang.String repoName, java.lang.String filePath, java.lang.String commitMessage)특정 Repository의 파일을 삭제합니다.FileContentgetFileContent(RepoType repoType, java.lang.String repoName, java.lang.String filePath)특정 Repository의 파일 내용을 조회합니다.java.util.List<GitFileInfo>listFilesAndDirectories(RepoType repoType, java.lang.String repoName, java.lang.String directoryPath)특정 Repository의 디렉토리 또는 파일 목록을 조회합니다.<T extends AbstractContentVO>
TparseFileContent(FileContent fileContent, java.lang.String filePath, java.lang.Class<T> targetVoType)FileContent 객체로부터 파일 내용을 추출하여 지정된 비즈니스 VO 타입으로 파싱합니다.<T extends AbstractContentVO>
booleanupsertFileContent(RepoType repoType, java.lang.String repoName, java.lang.String filePath, T configVo, java.lang.String commitMessage)특정 Repository에 파일 내용을 생성하거나 업데이트합니다.
-
-
-
Constructor Detail
-
GitFileServiceImpl
public GitFileServiceImpl(GiteaUserConfig giteaUserConfig, java.util.List<GitRepositoryProvider> providers, java.util.List<AbstractContentParser<?>> parsers)
-
-
Method Detail
-
getFileContent
public FileContent getFileContent(RepoType repoType, java.lang.String repoName, java.lang.String filePath)
Description copied from interface:GitFileService특정 Repository의 파일 내용을 조회합니다.- Specified by:
getFileContentin interfaceGitFileService- Parameters:
repoType- Git Repository 타입 (예: "gitea", "github")repoName- 대상 Repository 이름filePath- 조회할 파일 경로- Returns:
- 파일 내용과 메타데이터를 담은 FileContent 객체
-
upsertFileContent
public <T extends AbstractContentVO> boolean upsertFileContent(RepoType repoType, java.lang.String repoName, java.lang.String filePath, T configVo, java.lang.String commitMessage)
Description copied from interface:GitFileService특정 Repository에 파일 내용을 생성하거나 업데이트합니다.- Specified by:
upsertFileContentin interfaceGitFileService- Parameters:
repoType- Git Repository 타입repoName- 대상 Repository 이름filePath- 생성/업데이트할 파일 경로configVo- 저장할 비즈니스 VO (이 VO는 파일 내용으로 직렬화됩니다)commitMessage- 커밋 메시지- Returns:
- 성공 여부
-
listFilesAndDirectories
public java.util.List<GitFileInfo> listFilesAndDirectories(RepoType repoType, java.lang.String repoName, java.lang.String directoryPath)
Description copied from interface:GitFileService특정 Repository의 디렉토리 또는 파일 목록을 조회합니다.- Specified by:
listFilesAndDirectoriesin interfaceGitFileService- Parameters:
repoType- Git Repository 타입repoName- 대상 Repository 이름directoryPath- 조회할 디렉토리 경로- Returns:
- 디렉토리 내 GitFileInfo 목록
-
deleteFile
public boolean deleteFile(RepoType repoType, java.lang.String repoName, java.lang.String filePath, java.lang.String commitMessage)
Description copied from interface:GitFileService특정 Repository의 파일을 삭제합니다.- Specified by:
deleteFilein interfaceGitFileService- Parameters:
repoType- Git Repository 타입repoName- 대상 Repository 이름filePath- 삭제할 파일 경로commitMessage- 커밋 메시지- Returns:
- 성공 여부
-
parseFileContent
public <T extends AbstractContentVO> T parseFileContent(FileContent fileContent, java.lang.String filePath, java.lang.Class<T> targetVoType)
Description copied from interface:GitFileServiceFileContent 객체로부터 파일 내용을 추출하여 지정된 비즈니스 VO 타입으로 파싱합니다.- Specified by:
parseFileContentin interfaceGitFileService- Parameters:
fileContent- 조회된 파일 내용 객체filePath- 파일 경로 (파서 선택을 위해 확장자 추출에 사용)targetVoType- 파싱할 VO의 Class 타입- Returns:
- 파싱된 비즈니스 VO
-
-