Class GitHubResource

java.lang.Object
io.github.agentic.spring.ai.reader.github.GitHubResource
All Implemented Interfaces:
org.springframework.core.io.InputStreamSource, org.springframework.core.io.Resource

public class GitHubResource extends Object implements org.springframework.core.io.Resource
Since:
1.0.0
Author:
HeYQ
  • Constructor Details

    • GitHubResource

      public GitHubResource(org.kohsuke.github.GitHub gitHub, String owner, String repo, @Nullable String branch, String path)
    • GitHubResource

      public GitHubResource(org.kohsuke.github.GHContent content)
  • Method Details

    • getInstance

      public static GitHubResource getInstance(org.kohsuke.github.GHContent content)
    • getText

      public org.kohsuke.github.GHContent getText()
    • exists

      public boolean exists()
      Specified by:
      exists in interface org.springframework.core.io.Resource
    • getURL

      public URL getURL() throws IOException
      Specified by:
      getURL in interface org.springframework.core.io.Resource
      Throws:
      IOException
    • getURI

      public URI getURI() throws IOException
      Specified by:
      getURI in interface org.springframework.core.io.Resource
      Throws:
      IOException
    • getFile

      public File getFile() throws IOException
      Specified by:
      getFile in interface org.springframework.core.io.Resource
      Throws:
      IOException
    • contentLength

      public long contentLength() throws IOException
      Specified by:
      contentLength in interface org.springframework.core.io.Resource
      Throws:
      IOException
    • lastModified

      public long lastModified() throws IOException
      Specified by:
      lastModified in interface org.springframework.core.io.Resource
      Throws:
      IOException
    • createRelative

      public org.springframework.core.io.Resource createRelative(String relativePath) throws IOException
      Specified by:
      createRelative in interface org.springframework.core.io.Resource
      Throws:
      IOException
    • getFilename

      public String getFilename()
      Specified by:
      getFilename in interface org.springframework.core.io.Resource
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface org.springframework.core.io.Resource
    • getInputStream

      public InputStream getInputStream() throws IOException
      Specified by:
      getInputStream in interface org.springframework.core.io.InputStreamSource
      Throws:
      IOException
    • builder

      public static GitHubResource.Builder builder()