Package org.eclipse.jgit.lfs.server.fs
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 Summary
Constructors Constructor Description FileLfsRepository(String url, Path dir)Constructor for FileLfsRepository.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PathgetDir()Get the storage directoryResponse.ActiongetDownloadAction(AnyLongObjectId id)Get download actionprotected PathgetPath(AnyLongObjectId id)Get the path where the given object is storedlonggetSize(AnyLongObjectId id)Get size of an objectResponse.ActiongetUploadAction(AnyLongObjectId id, long size)Get upload actionStringgetUrl()Response.ActiongetVerifyAction(AnyLongObjectId id)Get verify actionvoidsetUrl(String url)
-
-
-
Constructor Detail
-
FileLfsRepository
public FileLfsRepository(String url, Path dir) throws IOException
Constructor for FileLfsRepository.
- Parameters:
url- external URL of this repositorydir- storage directory- Throws:
IOException
-
-
Method Detail
-
getDownloadAction
public Response.Action getDownloadAction(AnyLongObjectId id)
Get download action- Specified by:
getDownloadActionin interfaceLargeFileRepository- 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:
getUploadActionin interfaceLargeFileRepository- Parameters:
id- id of the object to uploadsize- 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:
getVerifyActionin interfaceLargeFileRepository- Parameters:
id- id of the object to be verified- Returns:
- Action for verifying the object, or
nullif the server doesn't support or require verification
-
getSize
public long getSize(AnyLongObjectId id) throws IOException
Get size of an object- Specified by:
getSizein interfaceLargeFileRepository- 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
-
-