diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-11-07 21:43:07 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2021-11-23 23:37:19 +0100 |
commit | 51545854392a08077631813dd8acdde3b642762c (patch) | |
tree | 65657bec3102b42c33e55c67534cd72c60b3dfda /org.eclipse.jgit/src/org/eclipse/jgit/transport/PackLock.java | |
parent | 1e37438cb7b2b16b2733693292904d03f1ecd906 (diff) | |
download | jgit-51545854392a08077631813dd8acdde3b642762c.tar.gz jgit-51545854392a08077631813dd8acdde3b642762c.zip |
[6.0 API cleanup] Public interface for PackLock
Provide a public interface PackLock exposing only the unlock() method.
Rename the internal PackLock class to PackLockImpl and have it implement
the new interface.
This way PackParser doesn't expose an internal class via its API
anymore, and client can still unlock pack locks that were created.
Bug: 576340
Change-Id: I976739f4ab28fe1f9ba7f35653a69a913aa68841
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/PackLock.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/PackLock.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackLock.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackLock.java new file mode 100644 index 0000000000..bf2140759f --- /dev/null +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackLock.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2021 Thomas Wolf <thomas.wolf@paranor.ch> and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Distribution License v. 1.0 which is available at + * https://www.eclipse.org/org/documents/edl-v10.php. + * + * SPDX-License-Identifier: BSD-3-Clause + */ +package org.eclipse.jgit.transport; + +import java.io.IOException; + +/** + * A {@code PackLock} describes a {@code .keep} file that holds a pack in place. + * If {@link PackParser#parse(org.eclipse.jgit.lib.ProgressMonitor)} creates + * such a pack lock, it returns the lock so that it can be unlocked once the + * pack doesn't need a {@code .keep} file anymore. + * + * @since 6.0 + */ +public interface PackLock { + + /** + * Remove the {@code .keep} file that holds a pack in place. + * + * @throws java.io.IOException + * if deletion of the {@code .keep} file failed + */ + void unlock() throws IOException; +} |