Interface GitFileService

  • All Known Implementing Classes:
    GitFileServiceImpl

    public interface GitFileService
    Git Repository에서 파일 내용을 조회, 업데이트, 삭제하고, 파싱된 VO로 변환하는 공통 파일 관리 서비스 인터페이스.
    • Method Summary

      All Methods Instance Methods Abstract 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에 파일 내용을 생성하거나 업데이트합니다.
    • Method Detail

      • getFileContent

        FileContent getFileContent​(RepoType repoType,
                                   java.lang.String repoName,
                                   java.lang.String filePath)
        특정 Repository의 파일 내용을 조회합니다.
        Parameters:
        repoType - Git Repository 타입 (예: "gitea", "github")
        repoName - 대상 Repository 이름
        filePath - 조회할 파일 경로
        Returns:
        파일 내용과 메타데이터를 담은 FileContent 객체
      • upsertFileContent

        <T extends AbstractContentVO> boolean upsertFileContent​(RepoType repoType,
                                                                java.lang.String repoName,
                                                                java.lang.String filePath,
                                                                T configVo,
                                                                java.lang.String commitMessage)
        특정 Repository에 파일 내용을 생성하거나 업데이트합니다.
        Parameters:
        repoType - Git Repository 타입
        repoName - 대상 Repository 이름
        filePath - 생성/업데이트할 파일 경로
        configVo - 저장할 비즈니스 VO (이 VO는 파일 내용으로 직렬화됩니다)
        commitMessage - 커밋 메시지
        Returns:
        성공 여부
      • listFilesAndDirectories

        java.util.List<GitFileInfo> listFilesAndDirectories​(RepoType repoType,
                                                            java.lang.String repoName,
                                                            java.lang.String directoryPath)
        특정 Repository의 디렉토리 또는 파일 목록을 조회합니다.
        Parameters:
        repoType - Git Repository 타입
        repoName - 대상 Repository 이름
        directoryPath - 조회할 디렉토리 경로
        Returns:
        디렉토리 내 GitFileInfo 목록
      • deleteFile

        boolean deleteFile​(RepoType repoType,
                           java.lang.String repoName,
                           java.lang.String filePath,
                           java.lang.String commitMessage)
        특정 Repository의 파일을 삭제합니다.
        Parameters:
        repoType - Git Repository 타입
        repoName - 대상 Repository 이름
        filePath - 삭제할 파일 경로
        commitMessage - 커밋 메시지
        Returns:
        성공 여부
      • parseFileContent

        <T extends AbstractContentVO> T parseFileContent​(FileContent fileContent,
                                                         java.lang.String filePath,
                                                         java.lang.Class<T> targetVoType)
        FileContent 객체로부터 파일 내용을 추출하여 지정된 비즈니스 VO 타입으로 파싱합니다.
        Parameters:
        fileContent - 조회된 파일 내용 객체
        filePath - 파일 경로 (파서 선택을 위해 확장자 추출에 사용)
        targetVoType - 파싱할 VO의 Class 타입
        Returns:
        파싱된 비즈니스 VO