Class FileLfsRepository

java.lang.Object
org.eclipse.jgit.lfs.server.fs.FileLfsRepository
All Implemented Interfaces:
LargeFileRepository

public class FileLfsRepository extends Object implements LargeFileRepository
Repository storing large objects in the file system
Since:
4.3
  • Constructor Details

    • FileLfsRepository

      public FileLfsRepository(String url, Path dir) throws IOException

      Constructor for FileLfsRepository.

      Parameters:
      url - external URL of this repository
      dir - storage directory
      Throws:
      IOException
  • Method Details

    • getDownloadAction

      public Response.Action getDownloadAction(AnyLongObjectId id)
      Get download action
      Specified by:
      getDownloadAction in interface LargeFileRepository
      Parameters:
      id - id of the object to download
      Returns:
      Action for downloading the object
    • getUploadAction

      public Response.Action getUploadAction(AnyLongObjectId id, long size)
      Get upload action
      Specified by:
      getUploadAction in interface LargeFileRepository
      Parameters:
      id - id of the object to upload
      size - size of the object to be uploaded
      Returns:
      Action for uploading the object
    • getVerifyAction

      @Nullable public Response.Action getVerifyAction(AnyLongObjectId id)
      Get verify action
      Specified by:
      getVerifyAction in interface LargeFileRepository
      Parameters:
      id - id of the object to be verified
      Returns:
      Action for verifying the object, or null if the server doesn't support or require verification
    • getSize

      public long getSize(AnyLongObjectId id) throws IOException
      Get size of an object
      Specified by:
      getSize in interface LargeFileRepository
      Parameters:
      id - id of the object
      Returns:
      length of the object content in bytes, -1 if the object doesn't exist
      Throws:
      IOException
    • getDir

      public Path getDir()
      Get the storage directory
      Returns:
      the path of the storage directory
    • getPath

      protected Path getPath(AnyLongObjectId id)
      Get the path where the given object is stored
      Parameters:
      id - id of a large object
      Returns:
      path the object's storage path
    • getUrl

      public String getUrl()
      Returns:
      the url of the content server
      Since:
      4.11
    • setUrl

      public void setUrl(String url)
      Parameters:
      url - the url of the content server
      Since:
      4.11