@Deprecated public class LRUCleaningResourceLoader extends DelegatingResourceLoader
ResourceLoader
that deletes returned Resources (assumed to
be on the file system) once disk space is getting low. Least Recently Used entries are removed first.
This wrapper is typically meant to be used to clean Maven .m2/repository entries, but also works
with other files. For the former case, if entries are under the configured repositoryCache
path (typically
the .m2/repository path), then the whole parent directory of the resource is removed. Otherwise, the sole
resource file is deleted.
Constructor and Description |
---|
LRUCleaningResourceLoader(org.springframework.core.io.ResourceLoader delegate,
float targetFreeSpaceRatio,
File repositoryCache)
Deprecated.
Instantiates a new LRUCleaning resource loader.
|
Modifier and Type | Method and Description |
---|---|
ClassLoader |
getClassLoader()
Deprecated.
|
org.springframework.core.io.Resource |
getResource(String location)
Deprecated.
|
setResourceLoader
public LRUCleaningResourceLoader(org.springframework.core.io.ResourceLoader delegate, float targetFreeSpaceRatio, File repositoryCache)
delegate
- the ResourceLoader to wrap, assumed to be file system based.targetFreeSpaceRatio
- The target free disk space ratio, between 0 and 1.repositoryCache
- The directory location of the maven cache.public org.springframework.core.io.Resource getResource(String location)
getResource
in interface org.springframework.core.io.ResourceLoader
getResource
in class DelegatingResourceLoader
public ClassLoader getClassLoader()
getClassLoader
in interface org.springframework.core.io.ResourceLoader
getClassLoader
in class DelegatingResourceLoader
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.