public class PackLock
extends java.lang.Object
PackFile's
associated .keep file.| Modifier and Type | Field and Description |
|---|---|
private java.io.File |
keepFile |
| Constructor and Description |
|---|
PackLock(java.io.File packFile,
FS fs)
Create a new lock for a pack file.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
lock(java.lang.String msg)
Create the
pack-*.keep file, with the given message. |
void |
unlock()
Remove the
.keep file that holds this pack in place. |
public PackLock(java.io.File packFile,
FS fs)
packFile - location of the pack-*.pack file.fs - the filesystem abstraction used by the repository.public boolean lock(java.lang.String msg)
throws java.io.IOException
pack-*.keep file, with the given message.msg - message to store in the file.java.io.IOException - the keep file could not be written.public void unlock()
throws java.io.IOException
.keep file that holds this pack in place.java.io.IOException - if deletion of .keep file failed