Class PackLockImpl
- java.lang.Object
-
- org.eclipse.jgit.internal.storage.file.PackLockImpl
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
keepFile
-
Constructor Summary
Constructors Constructor Description PackLockImpl(java.io.File packFile, FS fs)
Create a new lock for a pack file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
lock(java.lang.String msg)
Create thepack-*.keep
file, with the given message.void
unlock()
Remove the.keep
file that holds a pack in place.
-
-
-
Constructor Detail
-
PackLockImpl
public PackLockImpl(java.io.File packFile, FS fs)
Create a new lock for a pack file.- Parameters:
packFile
- location of thepack-*.pack
file.fs
- the filesystem abstraction used by the repository.
-
-
Method Detail
-
lock
public boolean lock(java.lang.String msg) throws java.io.IOException
Create thepack-*.keep
file, with the given message.- Parameters:
msg
- message to store in the file.- Returns:
- true if the keep file was successfully written; false otherwise.
- Throws:
java.io.IOException
- the keep file could not be written.
-
-