Package org.apache.ivy.plugins.repository.url

Examples of org.apache.ivy.plugins.repository.url.URLResource


                   
                    // create a new temporary parser to read the configurations from
                    // the specified file.
                    Parser parser = new Parser(getModuleDescriptorParser(), _ivy, false, url);
                    parser.md = new DefaultModuleDescriptor(getModuleDescriptorParser(),
                            new URLResource(url));
                    XMLHelper.parse(url , null, parser);

                    // add the configurations from this temporary parser to this module descriptor
                    Configuration[] configs = parser.getModuleDescriptor().getConfigurations();
                    for (int i = 0; i < configs.length; i++) {
View Full Code Here


public class PomModuleDescriptorParserTest extends AbstractModuleDescriptorParserTester {
    // junit test -- DO NOT REMOVE used by ant to know it's a junit test

    public void testAccept() throws Exception {
        assertTrue(PomModuleDescriptorParser.getInstance().accept(
            new URLResource(getClass().getResource("test-simple.pom"))));
        assertFalse(PomModuleDescriptorParser.getInstance().accept(
            new URLResource(XmlModuleDescriptorParserTest.class.getResource("test.xml"))));
    }
View Full Code Here

        if (confs == null || (confs.length == 1 && "*".equals(confs[0]))) {
            try {
                File ivyFile = options.getCache().getResolvedIvyFileInCache(mrid);
                Message.verbose("no explicit confs given for retrieve, using ivy file: " + ivyFile);
                URL ivySource = ivyFile.toURL();
                URLResource res = new URLResource(ivySource);
                ModuleDescriptorParser parser = ModuleDescriptorParserRegistry.getInstance()
                        .getParser(res);
                Message.debug("using " + parser + " to parse " + ivyFile);
                ModuleDescriptor md = parser.parseDescriptor(settings, ivySource, false);
                confs = md.getConfigurationsNames();
View Full Code Here

                throw new BuildException("destination ivy file is required for convertpom task");
            }
            ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(
                new IvySettings(), pomFile.toURL(), false);
            PomModuleDescriptorParser.getInstance().toIvyFile(pomFile.toURL().openStream(),
                new URLResource(pomFile.toURL()), getIvyFile(), md);
        } catch (MalformedURLException e) {
            throw new BuildException("unable to convert given pom file to url: " + pomFile + ": "
                    + e, e);
        } catch (ParseException e) {
            log(e.getMessage(), Project.MSG_ERR);
View Full Code Here

            ResolvedResource ret = findArtifactRef(artifact, date);
            if (ret == null && artifact.getUrl() != null) {
                URL url = artifact.getUrl();
                Message.verbose("\tusing url for " + artifact + ": " + url);
                logArtifactAttempt(artifact, url.toExternalForm());
                ret = new ResolvedResource(new URLResource(url), artifact.getModuleRevisionId()
                        .getRevision());
            }
            return ret;
        } finally {
            IvyContext.getContext().set(getName() + ".artifact", null);
View Full Code Here

public abstract class AbstractModuleDescriptorParser implements ModuleDescriptorParser {
    public ModuleDescriptor parseDescriptor(IvySettings ivySettings, URL descriptorURL,
            boolean validate) throws ParseException, IOException {
        return parseDescriptor(ivySettings, descriptorURL,
            new URLResource(descriptorURL), validate);
    }
View Full Code Here

            // create a new temporary parser to read the configurations from
            // the specified file.
            Parser parser = new Parser(getModuleDescriptorParser(), settings);
            parser.setInput(url);
            parser.setMd(new DefaultModuleDescriptor(getModuleDescriptorParser(),
                    new URLResource(url)));
            XMLHelper.parse(url , null, parser);

            // add the configurations from this temporary parser to this module descriptor
            Configuration[] configs = parser.getModuleDescriptor().getConfigurations();
            for (int i = 0; i < configs.length; i++) {
View Full Code Here

     * Resolve dependencies of a module described by an ivy file. Note: the method signature is way
     * too long, we should use a class to store the settings of the resolve.
     */
    public ResolveReport resolve(URL ivySource, ResolveOptions options) throws ParseException,
            IOException {
        URLResource res = new URLResource(ivySource);
        ModuleDescriptorParser parser = ModuleDescriptorParserRegistry.getInstance().getParser(res);
        Message.verbose("using " + parser + " to parse " + ivySource);
        ModuleDescriptor md = parser.parseDescriptor(settings, ivySource, options.isValidate());
        String revision = options.getRevision();
        if (revision == null && md.getResolvedModuleRevisionId().getRevision() == null) {
View Full Code Here

    /**
     * Resolve dependencies of a module described by an ivy file.
     */
    public ResolveReport resolve(URL ivySource, ResolveOptions options) throws ParseException,
            IOException {
        URLResource res = new URLResource(ivySource);
        ModuleDescriptorParser parser = ModuleDescriptorParserRegistry.getInstance().getParser(res);
        Message.verbose("using " + parser + " to parse " + ivySource);
        ModuleDescriptor md = parser.parseDescriptor(settings, ivySource, options.isValidate());
        String revision = options.getRevision();
        if (revision == null && md.getResolvedModuleRevisionId().getRevision() == null) {
View Full Code Here

        if (confs == null || (confs.length == 1 && "*".equals(confs[0]))) {
            try {
                File ivyFile = getCache().getResolvedIvyFileInCache(mrid);
                Message.verbose("no explicit confs given for retrieve, using ivy file: " + ivyFile);
                URL ivySource = ivyFile.toURI().toURL();
                URLResource res = new URLResource(ivySource);
                ModuleDescriptorParser parser = ModuleDescriptorParserRegistry.getInstance()
                        .getParser(res);
                Message.debug("using " + parser + " to parse " + ivyFile);
                ModuleDescriptor md = parser.parseDescriptor(settings, ivySource, false);
                confs = md.getConfigurationsNames();
View Full Code Here

TOP

Related Classes of org.apache.ivy.plugins.repository.url.URLResource

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.