Package org.springframework.ai.embedding
Class ResourceCacheService
java.lang.Object
org.springframework.ai.embedding.ResourceCacheService
Service that helps caching remote
Resources on the local file system.- Author:
- Christian Tzolov
-
Constructor Summary
ConstructorsConstructorDescriptionResourceCacheService(File rootCacheDirectory) ResourceCacheService(String rootCacheDirectory) -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.springframework.core.io.ResourcegetCachedResource(String originalResourceUri) GetResourcerepresenting the cached copy of the original resource.org.springframework.core.io.ResourcegetCachedResource(org.springframework.core.io.Resource originalResource) GetResourcerepresenting the cached copy of the original resource.voidsetExcludedUriSchemas(List<String> excludedUriSchemas) Overrides the excluded URI schemas list.
-
Constructor Details
-
ResourceCacheService
public ResourceCacheService() -
ResourceCacheService
-
ResourceCacheService
-
-
Method Details
-
setExcludedUriSchemas
Overrides the excluded URI schemas list.- Parameters:
excludedUriSchemas- new list of URI schemas to be excluded from caching.
-
getCachedResource
GetResourcerepresenting the cached copy of the original resource.- Parameters:
originalResourceUri- Resource to be cached.- Returns:
- Returns a cached resource. If the original resource's URI schema is within the excluded schema list the original resource is returned.
-
getCachedResource
public org.springframework.core.io.Resource getCachedResource(org.springframework.core.io.Resource originalResource) GetResourcerepresenting the cached copy of the original resource.- Parameters:
originalResource- Resource to be cached.- Returns:
- Returns a cached resource. If the original resource's URI schema is within the excluded schema list the original resource is returned.
-
deleteCacheFolder
public void deleteCacheFolder()
-