Package org.apache.ivy.plugins.repository

Examples of org.apache.ivy.plugins.repository.BasicResource


        XmlModuleDescriptorUpdater.update(settingsUrl, new BufferedOutputStream(buffer, 1024),
            getUpdateOptions("release", "mynewrev"));

        XmlModuleDescriptorParser parser = XmlModuleDescriptorParser.getInstance();
        ModuleDescriptor updatedMd = parser.parseDescriptor(new IvySettings(),
            new ByteArrayInputStream(buffer.toByteArray()), new BasicResource("test", false, 0, 0,
                    false), true);

        DependencyDescriptor[] dependencies = updatedMd.getDependencies();
        assertNotNull(dependencies);
        assertEquals(3, dependencies.length);
View Full Code Here


        XmlModuleDescriptorUpdater.update(settingsUrl, buffer,
            getUpdateOptions("release", "mynewrev").setConfsToExclude(new String[] {"myconf2"}));

        XmlModuleDescriptorParser parser = XmlModuleDescriptorParser.getInstance();
        ModuleDescriptor updatedMd = parser.parseDescriptor(new IvySettings(),
            new ByteArrayInputStream(buffer.toByteArray()), new BasicResource("test", false, 0, 0,
                    false), true);

        // test the number of configurations
        Configuration[] configs = updatedMd.getConfigurations();
        assertNotNull("Configurations shouldn't be null", configs);
View Full Code Here

            getUpdateOptions("release", "mynewrev")
                .setConfsToExclude(new String[] {"myconf2", "conf2"}));

        XmlModuleDescriptorParser parser = XmlModuleDescriptorParser.getInstance();
        ModuleDescriptor updatedMd = parser.parseDescriptor(new IvySettings(),
            new ByteArrayInputStream(buffer.toByteArray()), new BasicResource("test", false, 0, 0,
                    false), true);

        // test the number of configurations
        Configuration[] configs = updatedMd.getConfigurations();
        assertNotNull("Configurations shouldn't be null", configs);
View Full Code Here

        XmlModuleDescriptorUpdater.update(settingsUrl, buffer,
            getUpdateOptions("release", "mynewrev").setConfsToExclude(new String[] {"myconf2"}));

        XmlModuleDescriptorParser parser = XmlModuleDescriptorParser.getInstance();
        ModuleDescriptor updatedMd = parser.parseDescriptor(new IvySettings(),
            new ByteArrayInputStream(buffer.toByteArray()), new BasicResource("test", false, 0, 0,
                    false), true);

        // test the number of configurations
        Artifact[] artifacts = updatedMd.getAllArtifacts();
        assertNotNull("Published artifacts shouldn't be null", artifacts);
View Full Code Here

            getUpdateOptions("release", "mynewrev")
                .setConfsToExclude(new String[] {"myconf2"}));

        XmlModuleDescriptorParser parser = XmlModuleDescriptorParser.getInstance();
        ModuleDescriptor updatedMd = parser.parseDescriptor(new IvySettings(),
            new ByteArrayInputStream(buffer.toByteArray()), new BasicResource("test", false, 0, 0,
                    false), true);

        DependencyDescriptor[] deps = updatedMd.getDependencies();
        assertNotNull("Dependencies shouldn't be null", deps);
        assertEquals("Number of dependencies is incorrect", 8, deps.length);
View Full Code Here

                for (Iterator iter = r.iterator(); iter.hasNext();) {
                    Object obj = iter.next();
                    if (obj instanceof LsEntry) {
                        LsEntry entry = (LsEntry) obj;
                        SftpATTRS attrs = entry.getAttrs();
                        return new BasicResource(path, true, attrs.getSize(), attrs.getMTime()
                                * MILLIS_PER_SECOND, false);
                    }
                }
            }
        } catch (Exception e) {
            Message.debug("reolving resource error: " + e.getMessage());
            // silent fail, return unexisting resource
        }

        return new BasicResource(path, false, 0, 0, false);
    }
View Full Code Here

     * @param responseLine
     * @return
     */
    protected Resource lslToResource(String file, String responseLine) {
        if (responseLine == null || responseLine.startsWith("ls")) {
            return new BasicResource(file, false, 0, 0, false);
        } else {
            String[] parts = responseLine.split("\\s+");
            if (parts.length != LS_PARTS_NUMBER) {
                Message.debug("unrecognized ls format: " + responseLine);
                return new BasicResource(file, false, 0, 0, false);
            } else {
                try {
                    long contentLength = Long.parseLong(parts[LS_SIZE_INDEX]);
                    String date = parts[LS_DATE_INDEX1] + " " + parts[LS_DATE_INDEX2]
                                     + " " + parts[LS_DATE_INDEX3] + " " + parts[LS_DATE_INDEX4];
                    return new BasicResource(file, true, contentLength, FORMAT.parse(date)
                            .getTime(), false);
                } catch (Exception ex) {
                    Message
                            .warn("impossible to parse server response: " + responseLine + ": "
                                    + ex);
                    return new BasicResource(file, false, 0, 0, false);
                }
            }
        }
    }
View Full Code Here

     * @param responseLine
     * @return
     */
    protected Resource lslToResource(String file, String responseLine) {
        if (responseLine == null || responseLine.startsWith("ls")) {
            return new BasicResource(file, false, 0, 0, false);
        } else {
            String[] parts = responseLine.split("\\s+");
            if (parts.length != LS_PARTS_NUMBER) {
                Message.debug("unrecognized ls format: " + responseLine);
                return new BasicResource(file, false, 0, 0, false);
            } else {
                try {
                    long contentLength = Long.parseLong(parts[LS_SIZE_INDEX]);
                    String date = parts[LS_DATE_INDEX1] + " " + parts[LS_DATE_INDEX2]
                                     + " " + parts[LS_DATE_INDEX3] + " " + parts[LS_DATE_INDEX4];
                    return new BasicResource(file, true, contentLength, FORMAT.parse(date)
                            .getTime(), false);
                } catch (Exception ex) {
                    Message
                            .warn("impossible to parse server response: " + responseLine + ": "
                                    + ex);
                    return new BasicResource(file, false, 0, 0, false);
                }
            }
        }
    }
View Full Code Here

                for (Iterator iter = r.iterator(); iter.hasNext();) {
                    Object obj = iter.next();
                    if (obj instanceof LsEntry) {
                        LsEntry entry = (LsEntry) obj;
                        SftpATTRS attrs = entry.getAttrs();
                        return new BasicResource(path, true, attrs.getSize(), attrs.getMTime()
                                * MILLIS_PER_SECOND, false);
                    }
                }
            }
        } catch (Exception e) {
            Message.debug("reolving resource error: " + e.getMessage());
            // silent fail, return unexisting resource
        }

        return new BasicResource(path, false, 0, 0, false);
    }
View Full Code Here

        XmlModuleDescriptorUpdater.update(settingsUrl, new BufferedOutputStream(buffer, 1024),
            getUpdateOptions("release", "mynewrev"));

        XmlModuleDescriptorParser parser = XmlModuleDescriptorParser.getInstance();
        ModuleDescriptor updatedMd = parser.parseDescriptor(new IvySettings(),
            new ByteArrayInputStream(buffer.toByteArray()), new BasicResource("test", false, 0, 0,
                    false), true);

        DependencyDescriptor[] dependencies = updatedMd.getDependencies();
        assertNotNull(dependencies);
        assertEquals(3, dependencies.length);
View Full Code Here

TOP

Related Classes of org.apache.ivy.plugins.repository.BasicResource

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.