Package org.eclipse.jgit.lfs
Class Lfs
- java.lang.Object
-
- org.eclipse.jgit.lfs.Lfs
-
public class Lfs extends java.lang.Object
Class which represents the lfs folder hierarchy inside a.git
folder- Since:
- 4.6
-
-
Constructor Summary
Constructors Constructor Description Lfs(Repository db)
Constructor for Lfs.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.file.Path
createTmpFile()
Create a new temp file in the LFS directoryjava.nio.file.Path
getLfsObjDir()
Get the object directory used by LFSjava.nio.file.Path
getLfsRoot()
Get the LFS root directoryjava.nio.file.Path
getLfsTmpDir()
Get the path to the temporary directory used by LFS.java.nio.file.Path
getMediaFile(AnyLongObjectId id)
Get the media file which stores the original content
-
-
-
Constructor Detail
-
Lfs
public Lfs(Repository db)
Constructor for Lfs.- Parameters:
db
- the associated repo- Since:
- 4.11
-
-
Method Detail
-
getLfsRoot
public java.nio.file.Path getLfsRoot()
Get the LFS root directory- Returns:
- the path to the LFS directory
-
getLfsTmpDir
public java.nio.file.Path getLfsTmpDir()
Get the path to the temporary directory used by LFS.- Returns:
- the path to the temporary directory used by LFS. Will be
<repo>/.git/lfs/tmp
-
getLfsObjDir
public java.nio.file.Path getLfsObjDir()
Get the object directory used by LFS- Returns:
- the path to the object directory used by LFS. Will be
<repo>/.git/lfs/objects
-
getMediaFile
public java.nio.file.Path getMediaFile(AnyLongObjectId id)
Get the media file which stores the original content- Parameters:
id
- the id of the mediafile- Returns:
- the file which stores the original content. Its path will look
like
"<repo>/.git/lfs/objects/<firstTwoLettersOfID>/<remainingLettersOfID>"
-
createTmpFile
public java.nio.file.Path createTmpFile() throws java.io.IOException
Create a new temp file in the LFS directory- Returns:
- a new temporary file in the LFS directory
- Throws:
java.io.IOException
- when the temp file could not be created
-
-