Package jetbrains.buildServer.artifacts
Interface LocalCache
-
- All Known Subinterfaces:
FileCache
- All Known Implementing Classes:
HttpCacheImpl
public interface LocalCacheCreated by Nikita Skvortsov date: 02.10.13.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcleanUpCache()Cleanup cache: delete outdated items according to current cache optionsvoidcleanUpCache(long itemLifeTimeMillis)Delete items from cache whose life time in cache is greater than specified valuevoidcleanUpCache(long curMaxLifeTimeMs, Condition<Void> isInterrupted)Delete items from cache whose life time in cache is greater than specified value Allows to interrupt.voiddelete(String key)Delete cache entry.FilegetCachedFile(String key, String expectedDigest)CacheOptionsgetCacheOptions()Get cache optionsCollection<File>listCache()List cache content.voidputFile(String key, File file)Put file into cache under given key.voidputFile(String key, File file, String digest)Put file into cache under given key with given digest.voidputFiles(Map<String,File> keyToFileMap, Map<File,String> fileToDigestMap)Put files into cache under given keys.
-
-
-
Method Detail
-
putFile
void putFile(@NotNull String key, @NotNull File file) throws IOExceptionPut file into cache under given key.- Parameters:
key-file-- Throws:
IOException
-
putFile
void putFile(@NotNull String key, @NotNull File file, @Nullable String digest) throws IOExceptionPut file into cache under given key with given digest.- Parameters:
key-file-digest-- Throws:
IOException
-
putFiles
void putFiles(@NotNull Map<String,File> keyToFileMap, @NotNull Map<File,String> fileToDigestMap) throws IOExceptionPut files into cache under given keys.- Parameters:
keyToFileMap- mapping of keys to filesfileToDigestMap- mapping of files to file digests- Throws:
IOException
-
delete
void delete(@NotNull String key)Delete cache entry. Deletes cache entry and underlying content file.- Parameters:
key- key to delete
-
listCache
@NotNull Collection<File> listCache()
List cache content.- Returns:
- collection of all files on disk in cache
-
getCacheOptions
@NotNull CacheOptions getCacheOptions()
Get cache options- Returns:
- current cache options
-
cleanUpCache
void cleanUpCache()
Cleanup cache: delete outdated items according to current cache options
-
cleanUpCache
void cleanUpCache(long curMaxLifeTimeMs, Condition<Void> isInterrupted)Delete items from cache whose life time in cache is greater than specified value Allows to interrupt.- Parameters:
curMaxLifeTimeMs-isInterrupted- predicate to check for interrupt
-
cleanUpCache
void cleanUpCache(long itemLifeTimeMillis)
Delete items from cache whose life time in cache is greater than specified value
-
-