Package net.sourceforge.processdash.tool.bridge

Examples of net.sourceforge.processdash.tool.bridge.ResourceListing


    public static ResourceCollectionInfo parseListing(InputStream in)
            throws IOException {
        try {
            Element data = XMLUtils.parse(in).getDocumentElement();
            ResourceListing result = new ResourceListing();
            NodeList resourceElems = data.getElementsByTagName(RESOURCE_TAG);
            if (resourceElems != null) {
                for (int i = 0; i < resourceElems.getLength(); i++) {
                    Element res = (Element) resourceElems.item(i);
                    String name = res.getAttribute(NAME_ATTR);
                    long mod = Long.parseLong(res.getAttribute(MOD_TIME_ATTR));
                    long sum = Long.parseLong(res.getAttribute(CHECKSUM_ATTR));
                    result.addResource(name, mod, sum);
                }
            }
            return result;
        } catch (Exception e) {
            IOException ioe = new IOException(
View Full Code Here


            if (timestamp == null)
                return false;
            ResourceFilter filter = ResourceFilterFactory
                    .getForRequest(Collections.singletonMap(
                        ResourceFilterFactory.LAST_MOD_PARAM, timestamp));
            ResourceCollectionInfo changedFiles = new ResourceListing(
                    client.localCollection, filter);
            return changedFiles.listResourceNames().isEmpty();
        } catch (Exception e) {
            return false;
        }
    }
View Full Code Here

    private ResourceCollectionDiff getDiff() throws IOException {
        // start by initiating the HTTP connection to the server
        URLConnection conn = makeGetRequest(LIST_ACTION);
        conn.connect();
        // now, while the server is thinking, do our calculations locally.
        ResourceCollectionInfo localList = new ResourceListing(localCollection,
                ResourceFilterFactory.DEFAULT_FILTER);
        // finally, retrieve the list from the server and compare the two.
        ResourceCollectionInfo remoteList = XmlCollectionListing
                .parseListing(new BufferedInputStream(conn.getInputStream()));
        return new ResourceCollectionDiff(localList, remoteList);
View Full Code Here

TOP

Related Classes of net.sourceforge.processdash.tool.bridge.ResourceListing

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.