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 java.lang.Object implements LargeFileRepository
Repository storing large objects in the file system- Since:
- 4.3
-
-
Constructor Summary
Constructors Constructor Description FileLfsRepository(java.lang.String url, java.nio.file.Path dir)
Constructor for FileLfsRepository.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void
formatHexChar(char[] dst, int p, int b)
private Response.Action
getAction(AnyLongObjectId id)
java.nio.file.Path
getDir()
Get the storage directoryResponse.Action
getDownloadAction(AnyLongObjectId id)
Get download action(package private) AtomicObjectOutputStream
getOutputStream(AnyLongObjectId id)
protected java.nio.file.Path
getPath(AnyLongObjectId id)
Get the path where the given object is stored(package private) java.nio.channels.ReadableByteChannel
getReadChannel(AnyLongObjectId id)
long
getSize(AnyLongObjectId id)
Get size of an objectResponse.Action
getUploadAction(AnyLongObjectId id, long size)
Get upload actionjava.lang.String
getUrl()
Response.Action
getVerifyAction(AnyLongObjectId id)
Get verify actionvoid
setUrl(java.lang.String url)
private static char[]
toHexCharArray(int b)
-
-
-
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 java.io.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:
java.io.IOException
-
getDir
public java.nio.file.Path getDir()
Get the storage directory- Returns:
- the path of the storage directory
-
getPath
protected java.nio.file.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
-
getAction
private Response.Action getAction(AnyLongObjectId id)
-
getReadChannel
java.nio.channels.ReadableByteChannel getReadChannel(AnyLongObjectId id) throws java.io.IOException
- Throws:
java.io.IOException
-
getOutputStream
AtomicObjectOutputStream getOutputStream(AnyLongObjectId id) throws java.io.IOException
- Throws:
java.io.IOException
-
toHexCharArray
private static char[] toHexCharArray(int b)
-
formatHexChar
private static void formatHexChar(char[] dst, int p, int b)
-
getUrl
public java.lang.String getUrl()
- Returns:
- the url of the content server
- Since:
- 4.11
-
setUrl
public void setUrl(java.lang.String url)
- Parameters:
url
- the url of the content server- Since:
- 4.11
-
-