io.bdeploy.bhive.op.DirectoryModificationOperation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api Show documentation
Show all versions of api Show documentation
Public API including dependencies, ready to be used for integrations and plugins.
package io.bdeploy.bhive.op;
import static io.bdeploy.common.util.RuntimeAssert.assertNotNull;
import java.nio.file.Path;
import io.bdeploy.bhive.BHive;
public abstract class DirectoryModificationOperation extends BHive.Operation {
protected static final int RETRIES = 100_000;
protected static final int SLEEP_MILLIS = 10;
protected Path directory;
@Override
public Void call() throws Exception {
assertNotNull(directory, "No directory to lock.");
doCall(directory.resolve(".lock"));
return null;
}
/**
* Sets the directory that should be locked.
*/
public DirectoryModificationOperation setDirectory(Path directory) {
this.directory = directory;
return this;
}
protected abstract void doCall(Path lockFile);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy