Package jetbrains.buildServer.artifacts
Interface LocalCache
-
- All Known Subinterfaces:
FileCache
- All Known Implementing Classes:
HttpCacheImpl
public interface LocalCache
Created by Nikita Skvortsov date: 02.10.13.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cleanUpCache()
Cleanup cache: delete outdated items according to current cache optionsvoid
cleanUpCache(long itemLifeTimeMillis)
Delete items from cache whose life time in cache is greater than specified valuevoid
cleanUpCache(long curMaxLifeTimeMs, Condition<Void> isInterrupted)
Delete items from cache whose life time in cache is greater than specified value Allows to interrupt.void
delete(String key)
Delete cache entry.File
getCachedFile(String key, String expectedDigest)
CacheOptions
getCacheOptions()
Get cache optionsCollection<File>
listCache()
List cache content.void
putFile(String key, File file)
Put file into cache under given key.void
putFile(String key, File file, String digest)
Put file into cache under given key with given digest.void
putFiles(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 IOException
Put file into cache under given key.- Parameters:
key
-file
-- Throws:
IOException
-
putFile
void putFile(@NotNull String key, @NotNull File file, @Nullable String digest) throws IOException
Put 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 IOException
Put 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
-
-