Package org.apache.ivy.core.cache

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


    protected void setUp() throws Exception {
        IvySettings ivySettings = new IvySettings();
        cache = new File("build/cache");
        cache.mkdirs();
        ivySettings.setDefaultCache(cache);
        CacheResourceOptions options = new CacheResourceOptions();
        loader = new UpdateSiteLoader(ivySettings.getDefaultRepositoryCacheManager(), null, options);
    }
View Full Code Here


            try {
                if (eventManager != null) {
                    getRepository().addTransferListener(eventManager);
                }
                Resource obrResource = new URLResource(url);
                CacheResourceOptions options = new CacheResourceOptions();
                if (metadataTtl != null) {
                    options.setTtl(metadataTtl.longValue());
                }
                if (forceMetadataUpdate != null) {
                    options.setForce(forceMetadataUpdate.booleanValue());
                }
                report = getRepositoryCacheManager().downloadRepositoryResource(obrResource, "obr",
                    "obr", "xml", options, getRepository());
            } finally {
                if (eventManager != null) {
View Full Code Here

    protected void init() {
        if (url == null) {
            throw new RuntimeException("Missing url");
        }
        CacheResourceOptions options = new CacheResourceOptions();
        if (metadataTtl != null) {
            options.setTtl(metadataTtl.longValue());
        }
        if (forceMetadataUpdate != null) {
            options.setForce(forceMetadataUpdate.booleanValue());
        }
        final int log;
        if (logLevel != null) {
            if ("debug".equalsIgnoreCase(logLevel)) {
                log = Message.MSG_DEBUG;
            } else if ("verbose".equalsIgnoreCase(logLevel)) {
                log = Message.MSG_VERBOSE;
            } else if ("info".equalsIgnoreCase(logLevel)) {
                log = Message.MSG_INFO;
            } else if ("warn".equalsIgnoreCase(logLevel)) {
                log = Message.MSG_WARN;
            } else if ("error".equalsIgnoreCase(logLevel)) {
                log = Message.MSG_ERR;
            } else {
                throw new RuntimeException("Unknown log level: " + logLevel);
            }
        } else {
            log = Message.MSG_INFO;
        }
        options.setListener(new DownloadListener() {
            public void startArtifactDownload(RepositoryCacheManager cache, ResolvedResource rres,
                    Artifact artifact, ArtifactOrigin origin) {
                if (log <= Message.MSG_INFO) {
                    Message.info("\tdownloading " + rres.getResource().getName());
                }
View Full Code Here

            try {
                if (eventManager != null) {
                    getRepository().addTransferListener(eventManager);
                }
                Resource jarResource = new URLResource(url);
                CacheResourceOptions options = new CacheResourceOptions();
                report = getRepositoryCacheManager().downloadRepositoryResource(jarResource,
                    "jarrepository", "jar", "jar", options, new URLRepository());
            } finally {
                if (eventManager != null) {
                    getRepository().removeTransferListener(eventManager);
View Full Code Here

        URLRepository urlRepository = new URLRepository();
        if (getEventManager() != null) {
            urlRepository.addTransferListener(getEventManager());
        }
        URLResource mirrorResource = new URLResource(mirrorListUrl);
        CacheResourceOptions options = new CacheResourceOptions();
        ArtifactDownloadReport report = getRepositoryCacheManager().downloadRepositoryResource(
            mirrorResource, "mirrorlist", "text", "txt", options, urlRepository);
        return report.getLocalFile();
    }
View Full Code Here

    protected void init() {
        if (url == null) {
            throw new RuntimeException("Missing url");
        }
        CacheResourceOptions options = new CacheResourceOptions();
        if (metadataTtl != null) {
            options.setTtl(metadataTtl.longValue());
        }
        if (forceMetadataUpdate != null) {
            options.setForce(forceMetadataUpdate.booleanValue());
        }
        UpdateSiteLoader loader = new UpdateSiteLoader(getRepositoryCacheManager(),
                getEventManager(), options);
        try {
            setRepoDescriptor(loader.load(new URI(url)));
View Full Code Here

            try {
                if (eventManager != null) {
                    getRepository().addTransferListener(eventManager);
                }
                Resource obrResource = new URLResource(url);
                CacheResourceOptions options = new CacheResourceOptions();
                if (metadataTtl != null) {
                    options.setTtl(metadataTtl.longValue());
                }
                if (forceMetadataUpdate != null) {
                    options.setForce(forceMetadataUpdate.booleanValue());
                }
                report = getRepositoryCacheManager().downloadRepositoryResource(obrResource, "obr",
                    "obr", "xml", options, getRepository());
            } finally {
                if (eventManager != null) {
View Full Code Here

    protected void setUp() throws Exception {
        IvySettings ivySettings = new IvySettings();
        cache = new File("build/cache");
        cache.mkdirs();
        ivySettings.setDefaultCache(cache);
        CacheResourceOptions options = new CacheResourceOptions();
        loader = new UpdateSiteLoader(ivySettings.getDefaultRepositoryCacheManager(), null, options);
    }
View Full Code Here

TOP

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

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.