Class GitResource

java.lang.Object
org.springframework.core.io.AbstractResource
org.craftercms.studio.impl.v2.repository.GitResource
All Implemented Interfaces:
org.springframework.core.io.InputStreamSource, org.springframework.core.io.Resource

public class GitResource extends org.springframework.core.io.AbstractResource
Implementation of AbstractResource that wraps an ObjectLoader from JGit
Since:
4.0.0
Author:
joseross
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.eclipse.jgit.lib.ObjectLoader
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    GitResource(org.eclipse.jgit.lib.ObjectLoader objectLoader)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
     
     
     
    long
     

    Methods inherited from class org.springframework.core.io.AbstractResource

    createRelative, equals, exists, getFile, getFileForLastModifiedCheck, getFilename, getURI, getURL, hashCode, isFile, isOpen, isReadable, readableChannel, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.springframework.core.io.Resource

    getContentAsByteArray, getContentAsString
  • Field Details

    • objectLoader

      protected final org.eclipse.jgit.lib.ObjectLoader objectLoader
  • Constructor Details

    • GitResource

      public GitResource(org.eclipse.jgit.lib.ObjectLoader objectLoader)
  • Method Details

    • getDescription

      public String getDescription()
    • getInputStream

      public InputStream getInputStream() throws IOException
      Throws:
      IOException
    • contentLength

      public long contentLength()
      Specified by:
      contentLength in interface org.springframework.core.io.Resource
      Overrides:
      contentLength in class org.springframework.core.io.AbstractResource
    • lastModified

      public long lastModified() throws IOException
      Specified by:
      lastModified in interface org.springframework.core.io.Resource
      Overrides:
      lastModified in class org.springframework.core.io.AbstractResource
      Throws:
      IOException