org.apache.ivy.plugins.lock
public class ArtifactLockStrategy extends FileBasedLockStrategy
FileBasedLockStrategy.CreateFileLocker, FileBasedLockStrategy.FileLocker, FileBasedLockStrategy.NIOFileLocker
Constructor and Description |
---|
ArtifactLockStrategy() |
ArtifactLockStrategy(boolean debugLocking) |
Modifier and Type | Method and Description |
---|---|
boolean |
lockArtifact(Artifact artifact,
java.io.File artifactFileToDownload)
Performs a lock before downloading the given
Artifact to the given file. |
void |
unlockArtifact(Artifact artifact,
java.io.File artifactFileToDownload)
Release the lock acquired for an artifact download.
|
acquireLock, releaseLock
getName, isDebugLocking, setName, toString
public ArtifactLockStrategy()
public ArtifactLockStrategy(boolean debugLocking)
public boolean lockArtifact(Artifact artifact, java.io.File artifactFileToDownload) throws java.lang.InterruptedException
LockStrategy
Artifact
to the given file.artifact
- the artifact about to be downloadedartifactFileToDownload
- the file where the artifact will be downloadedjava.lang.InterruptedException
- if the thread is interrupted while waiting to acquire the lockpublic void unlockArtifact(Artifact artifact, java.io.File artifactFileToDownload)
LockStrategy
artifact
- the artifact for which the lock was acquiredartifactFileToDownload
- the file where the artifact is supposed to have been downloaded