Package slash.navigation.rest

Examples of slash.navigation.rest.Head.executeAsString()


                "http://download.mapsforge.org/maps/asia/azerbaijan.map",
                "http://ftp5.gwdg.de/pub/misc/openstreetmap/openandromaps/maps/Germany/berlin.zip"  // Content-Type: application/zip
        };
        for (String url : URLS) {
            Head head200 = new Head(url);
            head200.executeAsString();
            assertTrue(head200.isOk());
            assertTrue(head200.getAcceptByteRanges());
            assertNotNull(head200.getETag());
            assertNotNull(head200.getLastModified());
            assertNotNull(head200.getContentLength());
View Full Code Here


            assertNotNull(head200.getContentLength());
            System.out.println(url + ":\nHEAD 200: " + head200.getHeaders());

            Head head304IfModifiedSince = new Head(url);
            head304IfModifiedSince.setIfModifiedSince(head200.getLastModified());
            head304IfModifiedSince.executeAsString();
            assertTrue(head304IfModifiedSince.isNotModified());
            assertFalse(head304IfModifiedSince.getAcceptByteRanges());
            assertNotNull(head304IfModifiedSince.getETag());
            assertNull(head304IfModifiedSince.getLastModified());
            assertNull(head304IfModifiedSince.getContentLength());
View Full Code Here

            assertNull(head304IfModifiedSince.getContentLength());
            System.out.println(head304IfModifiedSince.getHeaders());

            Head head304Etag = new Head(url);
            head304Etag.setIfNoneMatch(head200.getETag());
            head304Etag.executeAsString();
            assertTrue(head304Etag.isNotModified());
            assertFalse(head304Etag.getAcceptByteRanges());
            assertNotNull(head304Etag.getETag());
            assertNull(head304Etag.getLastModified());
            assertNull(head304Etag.getContentLength());
View Full Code Here

            // intentionally do nothing
        }
        System.out.println(getClass().getSimpleName() + ": Extracting content length and last modified from " + baseUrl + uri + " (" + index + ")");
        try {
            Head head = new Head(baseUrl + uri);
            head.executeAsString();
            if (head.isSuccessful()) {
                return new ContentLengthAndLastModified(head.getContentLength(), head.getLastModified());
            }
        } catch (IOException e) {
            System.err.println(getClass().getSimpleName() + ": " + e.getMessage());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.