Package org.eclipse.jgit.lfs
Class Lfs
- java.lang.Object
-
- org.eclipse.jgit.lfs.Lfs
-
public class Lfs extends 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 Path
createTmpFile()
Create a new temp file in the LFS directoryPath
getLfsObjDir()
Get the object directory used by LFSPath
getLfsRoot()
Get the LFS root directoryPath
getLfsTmpDir()
Get the path to the temporary directory used by LFS.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 Path getLfsRoot()
Get the LFS root directory- Returns:
- the path to the LFS directory
-
getLfsTmpDir
public 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 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 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 Path createTmpFile() throws IOException
Create a new temp file in the LFS directory- Returns:
- a new temporary file in the LFS directory
- Throws:
IOException
- when the temp file could not be created
-
-