Modifier and Type | Class and Description |
---|---|
static class |
FileModeCache.CacheItem
An item from a
FileModeCache , recording information about a git
path (known from context). |
Constructor and Description |
---|
FileModeCache(Repository repo)
Creates a new
FileModeCache for a Repository . |
Modifier and Type | Method and Description |
---|---|
Repository |
getRepository()
Retrieves the
Repository . |
FileModeCache.CacheItem |
getRoot()
Obtains the
FileModeCache.CacheItem for the working tree root. |
FileModeCache.CacheItem |
safeCreateDirectory(String gitPath,
File dir,
boolean makeSpace)
Ensures the given directory
dir with the given git path exists. |
void |
safeCreateParentDirectory(String gitPath,
File parentDir,
boolean makeSpace)
Ensure that the given parent directory exists, and cache the information
that gitPath refers to a file.
|
public FileModeCache(@NonNull Repository repo)
FileModeCache
for a Repository
.repo
- Repository
this cache is for@NonNull public Repository getRepository()
Repository
.Repository
this FileModeCache
was created for@NonNull public FileModeCache.CacheItem getRoot()
FileModeCache.CacheItem
for the working tree root.FileModeCache.CacheItem
public void safeCreateParentDirectory(String gitPath, File parentDir, boolean makeSpace) throws IOException
gitPath
- of the file to be writtenparentDir
- directory in which the file shall be placed, assumed to be the
parent of the gitPath
makeSpace
- whether to delete a possibly existing file at
parentDir
IOException
- if the directory cannot be created, if necessarypublic FileModeCache.CacheItem safeCreateDirectory(String gitPath, File dir, boolean makeSpace) throws IOException
dir
with the given git path exists.gitPath
- of a file to be writtendir
- directory in which the file shall be placed, assumed to be the
parent of the gitPath
makeSpace
- whether to remove a file that already at that nameFileModeCache.CacheItem
describing the directory, which is guaranteed
to existIOException
- if the directory cannot be made to exist at the given
locationCopyright © 2023 Eclipse JGit Project. All rights reserved.