Top Description Fields Constructors Methods
org.eclipse.jgit.internal.storage.file

public Class PackLockImpl

extends Object
implements PackLock
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.transport.PackLock
Imports
java.io.File, .IOException, org.eclipse.jgit.lib.Constants, org.eclipse.jgit.transport.PackLock, org.eclipse.jgit.util.FS, .FileUtils

Keeps track of a org.eclipse.jgit.internal.storage.file.Pack's associated .keep file.

Field Summary

Modifier and TypeField and Description
private final File

Constructor Summary

AccessConstructor and Description
public
PackLockImpl(File
location of the pack-*.pack file.
packFile
,
FS
the filesystem abstraction used by the repository.
fs
)

Create a new lock for a pack file.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the keep file was successfully written; false otherwise.
lock
(String
message to store in the file.
msg
)

Create the pack-*.keep file, with the given message.

public void
unlock()

Implements org.eclipse.jgit.transport.PackLock.unlock.

Remove the .keep file that holds a pack in place.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keepFileback to summary
private final File keepFile

Constructor Detail

PackLockImplback to summary
public PackLockImpl(File packFile, FS fs)

Create a new lock for a pack file.

Parameters
packFile:File

location of the pack-*.pack file.

fs:FS

the filesystem abstraction used by the repository.

Method Detail

lockback to summary
public boolean lock(String msg) throws IOException

Create the pack-*.keep file, with the given message.

Parameters
msg:String

message to store in the file.

Returns:boolean

true if the keep file was successfully written; false otherwise.

Exceptions
IOException:
the keep file could not be written.
unlockback to summary
public void unlock() throws IOException

Implements org.eclipse.jgit.transport.PackLock.unlock.

Doc from org.eclipse.jgit.transport.PackLock.unlock.

Remove the .keep file that holds a pack in place.

Annotations
@Override
Exceptions
IOException:
if deletion of the .keep file failed