org.apache.ivy.core.cache
Class CacheManager

java.lang.Object
  extended by org.apache.ivy.core.cache.CacheManager

public class CacheManager
extends java.lang.Object


Constructor Summary
CacheManager(IvySettings settings, java.io.File cache)
           
 
Method Summary
 ResolvedModuleRevision findModuleInCache(ModuleRevisionId mrid, boolean validate)
           
 java.io.File getArchiveFileInCache(Artifact artifact)
          Returns a File object pointing to where the artifact can be found on the local file system.
 java.io.File getArchiveFileInCache(Artifact artifact, ArtifactOrigin origin)
          Returns a File object pointing to where the artifact can be found on the local file system.
 java.io.File getArchiveFileInCache(Artifact artifact, ArtifactOrigin origin, boolean useOrigin)
          Returns a File object pointing to where the artifact can be found on the local file system, using or not the original location depending on the availability of origin information provided as parameter and the setting of useOrigin.
 java.lang.String getArchivePathInCache(Artifact artifact)
           
 java.lang.String getArchivePathInCache(Artifact artifact, ArtifactOrigin origin)
           
 java.io.File getCache()
           
 java.io.File getConfigurationResolveReportInCache(java.lang.String resolveId, java.lang.String conf)
           
 java.io.File[] getConfigurationResolveReportsInCache(java.lang.String resolveId)
           
static CacheManager getInstance(IvySettings settings)
           
static CacheManager getInstance(IvySettings settings, java.io.File cache)
           
 java.io.File getIvyFileInCache(ModuleRevisionId mrid)
           
 java.io.File getResolvedIvyFileInCache(ModuleRevisionId mrid)
           
 java.io.File getResolvedIvyPropertiesInCache(ModuleRevisionId mrid)
           
 ArtifactOrigin getSavedArtifactOrigin(Artifact artifact)
           
 void removeSavedArtifactOrigin(Artifact artifact)
           
 void saveArtifactOrigin(Artifact artifact, ArtifactOrigin origin)
           
 void saveArtResolver(ModuleDescriptor md, java.lang.String name)
          Saves the information of which resolver was used to resolve a md, so that this info can be retrieve later (even after a jvm restart) by getSavedArtResolverName(ModuleDescriptor md)
 void saveResolver(ModuleDescriptor md, java.lang.String name)
          Saves the information of which resolver was used to resolve a md, so that this info can be retrieve later (even after a jvm restart) by getSavedResolverName(ModuleDescriptor md)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheManager

public CacheManager(IvySettings settings,
                    java.io.File cache)
Method Detail

getInstance

public static CacheManager getInstance(IvySettings settings,
                                       java.io.File cache)

getInstance

public static CacheManager getInstance(IvySettings settings)

getResolvedIvyFileInCache

public java.io.File getResolvedIvyFileInCache(ModuleRevisionId mrid)

getResolvedIvyPropertiesInCache

public java.io.File getResolvedIvyPropertiesInCache(ModuleRevisionId mrid)

getIvyFileInCache

public java.io.File getIvyFileInCache(ModuleRevisionId mrid)

getConfigurationResolveReportInCache

public java.io.File getConfigurationResolveReportInCache(java.lang.String resolveId,
                                                         java.lang.String conf)

getConfigurationResolveReportsInCache

public java.io.File[] getConfigurationResolveReportsInCache(java.lang.String resolveId)

getArchiveFileInCache

public java.io.File getArchiveFileInCache(Artifact artifact)
Returns a File object pointing to where the artifact can be found on the local file system. This is usually in the cache, but it can be directly in the repository if it is local and if the resolve has been done with useOrigin = true


getArchiveFileInCache

public java.io.File getArchiveFileInCache(Artifact artifact,
                                          ArtifactOrigin origin)
Returns a File object pointing to where the artifact can be found on the local file system. This is usually in the cache, but it can be directly in the repository if it is local and if the resolve has been done with useOrigin = true


getArchiveFileInCache

public java.io.File getArchiveFileInCache(Artifact artifact,
                                          ArtifactOrigin origin,
                                          boolean useOrigin)
Returns a File object pointing to where the artifact can be found on the local file system, using or not the original location depending on the availability of origin information provided as parameter and the setting of useOrigin. If useOrigin is false, this method will always return the file in the cache.


getArchivePathInCache

public java.lang.String getArchivePathInCache(Artifact artifact)

getArchivePathInCache

public java.lang.String getArchivePathInCache(Artifact artifact,
                                              ArtifactOrigin origin)

saveResolver

public void saveResolver(ModuleDescriptor md,
                         java.lang.String name)
Saves the information of which resolver was used to resolve a md, so that this info can be retrieve later (even after a jvm restart) by getSavedResolverName(ModuleDescriptor md)

Parameters:
md - the module descriptor resolved
name - resolver name

saveArtResolver

public void saveArtResolver(ModuleDescriptor md,
                            java.lang.String name)
Saves the information of which resolver was used to resolve a md, so that this info can be retrieve later (even after a jvm restart) by getSavedArtResolverName(ModuleDescriptor md)

Parameters:
md - the module descriptor resolved
name - artifact resolver name

saveArtifactOrigin

public void saveArtifactOrigin(Artifact artifact,
                               ArtifactOrigin origin)

getSavedArtifactOrigin

public ArtifactOrigin getSavedArtifactOrigin(Artifact artifact)

removeSavedArtifactOrigin

public void removeSavedArtifactOrigin(Artifact artifact)

findModuleInCache

public ResolvedModuleRevision findModuleInCache(ModuleRevisionId mrid,
                                                boolean validate)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getCache

public java.io.File getCache()