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 Path
getDir()
Get the storage directoryResponse.Action
getDownloadAction(AnyLongObjectId id)
Get download actionprotected Path
getPath(AnyLongObjectId id)
Get the path where the given object is storedlong
getSize(AnyLongObjectId id)
Get size of an objectResponse.Action
getUploadAction(AnyLongObjectId id, long size)
Get upload actionString
getUrl()
Response.Action
getVerifyAction(AnyLongObjectId id)
Get verify actionvoid
setUrl(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:
getDownloadAction
in 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:
getUploadAction
in 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:
getVerifyAction
in interfaceLargeFileRepository
- 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 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
-
-