Class PackLock
- java.lang.Object
-
- org.eclipse.jgit.internal.storage.file.PackLock
-
public class PackLock extends java.lang.ObjectKeeps track of aPack's associated.keepfile.
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.FilekeepFile
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanlock(java.lang.String msg)Create thepack-*.keepfile, with the given message.voidunlock()Remove the.keepfile that holds this pack in place.
-
-
-
Constructor Detail
-
PackLock
public PackLock(java.io.File packFile, FS fs)Create a new lock for a pack file.- Parameters:
packFile- location of thepack-*.packfile.fs- the filesystem abstraction used by the repository.
-
-
Method Detail
-
lock
public boolean lock(java.lang.String msg) throws java.io.IOExceptionCreate thepack-*.keepfile, 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.
-
unlock
public void unlock() throws java.io.IOExceptionRemove the.keepfile that holds this pack in place.- Throws:
java.io.IOException- if deletion of .keep file failed
-
-