Class GitFileServiceImpl

  • All Implemented Interfaces:
    GitFileService

    @Service
    public class GitFileServiceImpl
    extends java.lang.Object
    implements GitFileService
    GitFileService 인터페이스의 구현체. Git Repository와 통신하여 파일 관리 및 파싱을 수행합니다.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean deleteFile​(RepoType repoType, java.lang.String repoName, java.lang.String filePath, java.lang.String commitMessage)
      특정 Repository의 파일을 삭제합니다.
      FileContent getFileContent​(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>
      T
      parseFileContent​(FileContent fileContent, java.lang.String filePath, java.lang.Class<T> targetVoType)
      FileContent 객체로부터 파일 내용을 추출하여 지정된 비즈니스 VO 타입으로 파싱합니다.
      <T extends AbstractContentVO>
      boolean
      upsertFileContent​(RepoType repoType, java.lang.String repoName, java.lang.String filePath, T configVo, java.lang.String commitMessage)
      특정 Repository에 파일 내용을 생성하거나 업데이트합니다.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getFileContent

        public FileContent getFileContent​(RepoType repoType,
                                          java.lang.String repoName,
                                          java.lang.String filePath)
        Description copied from interface: GitFileService
        특정 Repository의 파일 내용을 조회합니다.
        Specified by:
        getFileContent in interface GitFileService
        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:
        upsertFileContent in interface GitFileService
        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:
        listFilesAndDirectories in interface GitFileService
        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:
        deleteFile in interface GitFileService
        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: GitFileService
        FileContent 객체로부터 파일 내용을 추출하여 지정된 비즈니스 VO 타입으로 파싱합니다.
        Specified by:
        parseFileContent in interface GitFileService
        Parameters:
        fileContent - 조회된 파일 내용 객체
        filePath - 파일 경로 (파서 선택을 위해 확장자 추출에 사용)
        targetVoType - 파싱할 VO의 Class 타입
        Returns:
        파싱된 비즈니스 VO