Package org.apache.maven.buildcache
Class RemoteCacheRepositoryImpl
java.lang.Object
org.apache.maven.buildcache.RemoteCacheRepositoryImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,CacheRepository,RemoteCacheRepository
@Named("resolver")
public class RemoteCacheRepositoryImpl
extends Object
implements RemoteCacheRepository, Closeable
Remote cache repository implementation.
-
Field Summary
Fields inherited from interface org.apache.maven.buildcache.RemoteCacheRepository
BUILDINFO_XML, CACHE_REPORT_XML -
Constructor Summary
ConstructorsConstructorDescriptionRemoteCacheRepositoryImpl(XmlService xmlService, CacheConfig cacheConfig, org.apache.maven.execution.MavenSession mavenSession, org.eclipse.aether.spi.connector.transport.TransporterProvider transporterProvider) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()findBaselineBuild(org.apache.maven.project.MavenProject project) findBuild(CacheContext context) booleangetArtifactContent(CacheContext context, Artifact artifact, Path target) Download an artifact to the given location.Optional<byte[]>getResourceContent(String url) Downloads content of the resourcebooleangetResourceContent(String url, Path target) getResourceUrl(CacheContext context, String filename) voidsaveArtifactFile(CacheResult cacheResult, org.apache.maven.artifact.Artifact artifact) voidsaveBuildInfo(CacheResult cacheResult, Build build) voidsaveCacheReport(String buildId, org.apache.maven.execution.MavenSession session, CacheReport cacheReport)
-
Constructor Details
-
RemoteCacheRepositoryImpl
@Inject public RemoteCacheRepositoryImpl(XmlService xmlService, CacheConfig cacheConfig, org.apache.maven.execution.MavenSession mavenSession, org.eclipse.aether.spi.connector.transport.TransporterProvider transporterProvider) throws Exception - Throws:
Exception
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
findBuild
- Specified by:
findBuildin interfaceCacheRepository- Throws:
IOException
-
getArtifactContent
Description copied from interface:RemoteCacheRepositoryDownload an artifact to the given location. Returnstrueif success,falseif the artifact does not exists and throws anIOExceptionif a problem occurs.- Specified by:
getArtifactContentin interfaceRemoteCacheRepository
-
saveBuildInfo
- Specified by:
saveBuildInfoin interfaceCacheRepository- Throws:
IOException
-
saveCacheReport
public void saveCacheReport(String buildId, org.apache.maven.execution.MavenSession session, CacheReport cacheReport) throws IOException - Specified by:
saveCacheReportin interfaceCacheRepository- Throws:
IOException
-
saveArtifactFile
public void saveArtifactFile(CacheResult cacheResult, org.apache.maven.artifact.Artifact artifact) throws IOException - Specified by:
saveArtifactFilein interfaceCacheRepository- Throws:
IOException
-
getResourceContent
Downloads content of the resource- Returns:
- null or content
-
getResourceContent
-
getResourceUrl
- Specified by:
getResourceUrlin interfaceRemoteCacheRepository
-
findBaselineBuild
- Specified by:
findBaselineBuildin interfaceRemoteCacheRepository
-