Package org.apache.ivy.core.cache

Examples of org.apache.ivy.core.cache.RepositoryCacheManager


                        + "It will require the availability of the namespace '"
                        + getNamespace().getName() + "' to be fully usable.");
                }
            }

            RepositoryCacheManager cacheManager = getRepositoryCacheManager();
           
            // the metadata artifact which was used to cache the original metadata file
            Artifact requestedMetadataArtifact =
                ivyRef == null
                ? systemMd.getMetadataArtifact()
                : parser.getMetadataArtifact(
                    ModuleRevisionId.newInstance(systemMrid, ivyRef.getRevision()),
                    ivyRef.getResource());
           
            cacheManager.originalToCachedModuleDescriptor(this, ivyRef, requestedMetadataArtifact,
                    rmr, new ModuleDescriptorWriter() {
                public void write(ResolvedResource originalMdResource, ModuleDescriptor md,
                        File src, File dest)
                        throws IOException, ParseException {
                    if (originalMdResource == null) {
View Full Code Here


    protected boolean acceptLatest() {
        return true;
    }

    public DownloadReport download(Artifact[] artifacts, DownloadOptions options) {
        RepositoryCacheManager cacheManager = getRepositoryCacheManager();

        clearArtifactAttempts();
        DownloadReport dr = new DownloadReport();
        for (int i = 0; i < artifacts.length; i++) {
            ArtifactDownloadReport adr = cacheManager.download(
                artifacts[i], artifactResourceResolver, downloader,
                getCacheDownloadOptions(options));
            if (DownloadStatus.FAILED == adr.getDownloadStatus()) {
                if (!ArtifactDownloadReport.MISSING_ARTIFACT.equals(adr.getDownloadDetails())) {
                    Message.warn("\t" + adr);
View Full Code Here

                        + ivy.substitute(defaultLatest));
            }
            ivy.setDefaultLatestStrategy(latestStrategy);
        }
        if (defaultCacheManager != null) {
            RepositoryCacheManager cache = ivy.getRepositoryCacheManager(
                                                ivy.substitute(defaultCacheManager));
            if (cache == null) {
                throw new IllegalArgumentException("unknown cache manager "
                        + ivy.substitute(defaultCacheManager));
            }
View Full Code Here

                Artifact artifact = new DefaultArtifact(revId, null, artifactName, artifactType,
                        artifactExt);

                // TODO cache: see how we could know which actual cache manager to use, since this
                // will fail when using a resolver in a chain with a specific cache manager
                RepositoryCacheManager cacheManager = IvyContext.getContext().getSettings()
                        .getResolver(revId).getRepositoryCacheManager();

                origin = cacheManager.getSavedArtifactOrigin(artifact);

                if (origin == ArtifactOrigin.UNKNOWN) {
                    Message.debug("no artifact origin found for " + artifact + " in "
                            + cacheManager);
                    return null;
View Full Code Here

                            .getModuleRevision().getId());
                    if (artifactsOfModuleRev != null) {
                        for (Iterator iter = artifactsOfModuleRev.iterator(); iter.hasNext();) {
                            ArtifactDownloadReport artifact = (ArtifactDownloadReport) iter.next();
                           
                            RepositoryCacheManager cache = dependency.getModuleRevision()
                                .getArtifactResolver().getRepositoryCacheManager();

                            startArtifact(saxHandler, artifact.getArtifact());

                            writeOriginLocationIfPresent(cache, saxHandler, artifact);
View Full Code Here

        }
    }

    private void cleanRespoitoryCache(Ivy ivy, String name, ProgressHandle progressHandle) {
        progressHandle.setDisplayName(NbBundle.getMessage(IvyFacade.class, "CleanResolution") + " " + name);
        RepositoryCacheManager manager = ivy.getSettings().getRepositoryCacheManager(name);
        manager.clean();
    }
View Full Code Here

    public String[] getResolutionCacheNames(Project project) throws IvyException {
        Ivy ivy = getIvy(project);
        RepositoryCacheManager[] managers = ivy.getSettings().getRepositoryCacheManagers();
        String[] retVal = new String[managers.length];
        for (int i = 0; i < managers.length; i++) {
            RepositoryCacheManager repositoryCacheManager = managers[i];
            retVal[i] = repositoryCacheManager.getName();
        }
        return retVal;
    }
View Full Code Here

            rmr.getDescriptor(), rmr.getReport(), true);
    }

    private void cacheModuleDescriptor(ModuleDescriptor systemMd, ModuleRevisionId systemMrid,
            ResolvedResource ivyRef, ResolvedModuleRevision rmr) {
        RepositoryCacheManager cacheManager = getRepositoryCacheManager();
       
        final ModuleDescriptorParser parser = systemMd.getParser();
       
        // the metadata artifact which was used to cache the original metadata file
        Artifact requestedMetadataArtifact =
            ivyRef == null
            ? systemMd.getMetadataArtifact()
            : parser.getMetadataArtifact(
                ModuleRevisionId.newInstance(systemMrid, ivyRef.getRevision()),
                ivyRef.getResource());
       
        cacheManager.originalToCachedModuleDescriptor(this, ivyRef, requestedMetadataArtifact,
                rmr, new ModuleDescriptorWriter() {
            public void write(ResolvedResource originalMdResource, ModuleDescriptor md,
                    File src, File dest)
                    throws IOException, ParseException {
                if (originalMdResource == null) {
View Full Code Here

    protected boolean acceptLatest() {
        return true;
    }

    public DownloadReport download(Artifact[] artifacts, DownloadOptions options) {
        RepositoryCacheManager cacheManager = getRepositoryCacheManager();

        clearArtifactAttempts();
        DownloadReport dr = new DownloadReport();
        for (int i = 0; i < artifacts.length; i++) {
            ArtifactDownloadReport adr = cacheManager.download(
                artifacts[i], artifactResourceResolver, downloader,
                getCacheDownloadOptions(options));
            if (DownloadStatus.FAILED == adr.getDownloadStatus()) {
                if (!ArtifactDownloadReport.MISSING_ARTIFACT.equals(adr.getDownloadDetails())) {
                    Message.warn("\t" + adr);
View Full Code Here

            rmr.getDescriptor(), rmr.getReport(), true);
    }

    private void cacheModuleDescriptor(ModuleDescriptor systemMd, ModuleRevisionId systemMrid,
            ResolvedResource ivyRef, ResolvedModuleRevision rmr) {
        RepositoryCacheManager cacheManager = getRepositoryCacheManager();
       
        final ModuleDescriptorParser parser = systemMd.getParser();
       
        // the metadata artifact which was used to cache the original metadata file
        Artifact requestedMetadataArtifact =
            ivyRef == null
            ? systemMd.getMetadataArtifact()
            : parser.getMetadataArtifact(
                ModuleRevisionId.newInstance(systemMrid, ivyRef.getRevision()),
                ivyRef.getResource());
       
        cacheManager.originalToCachedModuleDescriptor(this, ivyRef, requestedMetadataArtifact,
                rmr, new ModuleDescriptorWriter() {
            public void write(ResolvedResource originalMdResource, ModuleDescriptor md,
                    File src, File dest)
                    throws IOException, ParseException {
                if (originalMdResource == null) {
View Full Code Here

TOP

Related Classes of org.apache.ivy.core.cache.RepositoryCacheManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.