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 voidformatHexChar(char[] dst, int p, int b)private Response.ActiongetAction(AnyLongObjectId id)java.nio.file.PathgetDir()Get the storage directoryResponse.ActiongetDownloadAction(AnyLongObjectId id)Get download action(package private) AtomicObjectOutputStreamgetOutputStream(AnyLongObjectId id)protected java.nio.file.PathgetPath(AnyLongObjectId id)Get the path where the given object is stored(package private) java.nio.channels.ReadableByteChannelgetReadChannel(AnyLongObjectId id)longgetSize(AnyLongObjectId id)Get size of an objectResponse.ActiongetUploadAction(AnyLongObjectId id, long size)Get upload actionjava.lang.StringgetUrl()Response.ActiongetVerifyAction(AnyLongObjectId id)Get verify actionvoidsetUrl(java.lang.String url)private static char[]toHexCharArray(int b)
-
-
-
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 java.io.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:
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
-
-