Top Description Fields Constructors Methods
org.eclipse.jgit.lfs

public Class Lfs

extends Object
Class Inheritance
Static Imports
org.eclipse.jgit.lib.Constants.OBJECTS

Class which represents the lfs folder hierarchy inside a .git folder
Since
4.6

Field Summary

Modifier and TypeField and Description
private Path
private Path
private Path

Constructor Summary

AccessConstructor and Description
public
Lfs(Repository
the associated repo
db
)

Constructor for Lfs.

Method Summary

Modifier and TypeMethod and Description
public Path

Returns:

a new temporary file in the LFS directory
createTmpFile
()

Create a new temp file in the LFS directory

public Path

Returns:

the path to the object directory used by LFS. Will be <repo>/.git/lfs/objects
getLfsObjDir
()

Get the object directory used by LFS

public Path

Returns:

the path to the LFS directory
getLfsRoot
()

Get the LFS root directory

public Path

Returns:

the path to the temporary directory used by LFS. Will be <repo>/.git/lfs/tmp
getLfsTmpDir
()

Get the path to the temporary directory used by LFS.

public Path

Returns:

the file which stores the original content. Its path will look like "<repo>/.git/lfs/objects/<firstTwoLettersOfID>/<remainingLettersOfID>"
getMediaFile
(AnyLongObjectId
the id of the mediafile
id
)

Get the media file which stores the original content

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

objDirback to summary
private Path objDir
rootback to summary
private Path root
tmpDirback to summary
private Path tmpDir

Constructor Detail

Lfsback to summary
public Lfs(Repository db)

Constructor for Lfs.

Parameters
db:Repository

the associated repo

Since
4.11

Method Detail

createTmpFileback to summary
public Path createTmpFile() throws IOException

Create a new temp file in the LFS directory

Returns:Path

a new temporary file in the LFS directory

Exceptions
IOException:
when the temp file could not be created
getLfsObjDirback to summary
public Path getLfsObjDir()

Get the object directory used by LFS

Returns:Path

the path to the object directory used by LFS. Will be <repo>/.git/lfs/objects

getLfsRootback to summary
public Path getLfsRoot()

Get the LFS root directory

Returns:Path

the path to the LFS directory

getLfsTmpDirback to summary
public Path getLfsTmpDir()

Get the path to the temporary directory used by LFS.

Returns:Path

the path to the temporary directory used by LFS. Will be <repo>/.git/lfs/tmp

getMediaFileback to summary
public Path getMediaFile(AnyLongObjectId id)

Get the media file which stores the original content

Parameters
id:AnyLongObjectId

the id of the mediafile

Returns:Path

the file which stores the original content. Its path will look like "<repo>/.git/lfs/objects/<firstTwoLettersOfID>/<remainingLettersOfID>"