Class HttpDiskCache
- java.lang.Object
-
- jetbrains.buildServer.artifacts.impl.HttpDiskCache
-
public class HttpDiskCache extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONTENT_FILE_NAME
-
Constructor Summary
Constructors Constructor Description HttpDiskCache(File cacheDir, DigestCalculator calculator, ArtifactsCacheListener cacheMulticaster)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanUpCache()
void
cleanUpCache(long itemLifeTimeMillis)
void
cleanUpCache(long itemLifeTimeMillis, Condition<Void> isInterrupted)
void
cleanUpCache(Condition<Void> isInterrupted)
long
delete(String key)
CacheOptions
getCacheOptions()
File
getFile(String key, String digest)
File
getFile(String key, URLContentRetriever transport)
boolean
isValid(String key, URLContentRetriever transport)
Collection<File>
listCache()
void
processCacheEntries(Processor<jetbrains.buildServer.artifacts.impl.HttpCacheEntry> processor)
void
putFile(String key, File file)
void
putFile(String key, File file, String digest)
void
putFiles(Map<String,File> keyToFile)
void
putFiles(Map<String,File> keyToFile, Map<File,String> fileToDigest)
static void
setTimeService(TimeService timeService)
-
-
-
Field Detail
-
CONTENT_FILE_NAME
public static final String CONTENT_FILE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HttpDiskCache
public HttpDiskCache(@NotNull File cacheDir, @NotNull DigestCalculator calculator, @NotNull ArtifactsCacheListener cacheMulticaster)
-
-
Method Detail
-
isValid
public boolean isValid(@NotNull String key, @NotNull URLContentRetriever transport)
-
getFile
@NotNull public File getFile(@NotNull String key, @NotNull URLContentRetriever transport) throws IOException
- Throws:
IOException
-
getCacheOptions
@NotNull public CacheOptions getCacheOptions()
-
delete
public long delete(@NotNull String key)
-
cleanUpCache
public void cleanUpCache()
-
cleanUpCache
public void cleanUpCache(long itemLifeTimeMillis)
-
processCacheEntries
public void processCacheEntries(@NotNull Processor<jetbrains.buildServer.artifacts.impl.HttpCacheEntry> processor)
-
putFile
public void putFile(@NotNull String key, @NotNull File file) throws IOException
- Throws:
IOException
-
putFile
public void putFile(@NotNull String key, @NotNull File file, @Nullable String digest) throws IOException
- Throws:
IOException
-
putFiles
public void putFiles(@NotNull Map<String,File> keyToFile) throws IOException
- Throws:
IOException
-
putFiles
public void putFiles(@NotNull Map<String,File> keyToFile, @NotNull Map<File,String> fileToDigest) throws IOException
- Throws:
IOException
-
listCache
@NotNull public Collection<File> listCache()
-
setTimeService
public static void setTimeService(@NotNull TimeService timeService)
-
-