Package org.ossreviewtoolkit.downloader
Class DefaultWorkingTreeCache
-
- All Implemented Interfaces:
-
org.ossreviewtoolkit.downloader.WorkingTreeCache
public final class DefaultWorkingTreeCache implements WorkingTreeCache
-
-
Constructor Summary
Constructors Constructor Description DefaultWorkingTreeCache()
-
Method Summary
Modifier and Type Method Description <T extends Any> Tuse(VcsInfo vcsInfo, Function2<VersionControlSystem, WorkingTree, T> block)Apply the block to the working tree defined by vcsInfo. Unitshutdown()Shut down the cache and clear all cached working trees from the file system. -
-
Method Detail
-
use
<T extends Any> T use(VcsInfo vcsInfo, Function2<VersionControlSystem, WorkingTree, T> block)
Apply the block to the working tree defined by vcsInfo. The VcsInfo.revision is ignored during initialization of the working tree, it is the caller's responsibility to update the working tree to the correct revision. The VcsInfo.path is also ignored, so the caller needs to verify that the expected path exists. It is ensured that only one block at a time can access a single working tree, separate working trees can be accessed in parallel.
Throws an IllegalStateException if the cache was already shut down.
-
-
-
-