Examples of executeAsString()


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

        return "EarthTools";
    }

    public Double getElevationFor(double longitude, double latitude) throws IOException {
        Get get = new Get(getEarthToolsUrlPreference() + "height/" + latitude + "/" + longitude);
        String result = get.executeAsString();
        if (get.isSuccessful())
            try {
                Height height = unmarshal(result);
                Integer elevation = parseInt(height.getMeters());
                if (elevation != null && !elevation.equals(-9999))
View Full Code Here

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

    }

    public String getLocationFor(double longitude, double latitude) throws IOException {
        String url = getGeocodingUrl("latlng=" + latitude + "," + longitude);
        Get get = get(url);
        String result = get.executeAsString();
        if (get.isSuccessful())
            try {
                GeocodeResponse geocodeResponse = unmarshalGeocode(result);
                if (geocodeResponse != null) {
                    String status = geocodeResponse.getStatus();
View Full Code Here

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

    }

    public List<NavigationPosition> getPositionsFor(String address) throws IOException {
        String url = getGeocodingUrl("address=" + encodeUri(address));
        Get get = get(url);
        String result = get.executeAsString();
        if (get.isSuccessful())
            try {
                GeocodeResponse geocodeResponse = unmarshalGeocode(result);
                if (geocodeResponse != null) {
                    String status = geocodeResponse.getStatus();
View Full Code Here

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

    }

    public Double getElevationFor(double longitude, double latitude) throws IOException {
        String url = getElevationUrl("locations=" + latitude + "," + longitude); // TODO could be up to 512 locations
        Get get = get(url);
        String result = get.executeAsString();
        if (get.isSuccessful())
            try {
                ElevationResponse elevationResponse = unmarshalElevation(result);
                if (elevationResponse != null) {
                    String status = elevationResponse.getStatus();
View Full Code Here

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

    }

    GpxType fetchGpx(String url) throws IOException {
        log.fine("Fetching gpx from " + url);
        Get get = new Get(url);
        String result = get.executeAsString();
        if (get.isSuccessful())
            try {
                return unmarshal11(result);
            } catch (JAXBException e) {
                throw new IOException("Cannot unmarshall " + result + ": " + e, e);
View Full Code Here

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

            assertNull(head304Etag.getLastModified());
            assertNull(head304Etag.getContentLength());
            System.out.println(head304Etag.getHeaders());

            Get get200 = new Get(url);
            get200.executeAsString();
            assertTrue(get200.isOk());
            assertTrue(get200.getAcceptByteRanges());
            assertNotNull(get200.getETag());
            assertNotNull(get200.getLastModified());
            assertNotNull(get200.getContentLength());
View Full Code Here

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

            assertNotNull(get200.getContentLength());
            System.out.println("GET 200: " + get200.getHeaders());

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

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

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

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

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

    }

    private String execute(String uri) throws IOException {
        String url = getGeoNamesNamesUrl() + uri + "&username=" + getGeoNamesUserName();
        Get get = new Get(url);
        String result = get.executeAsString();
        if (get.isSuccessful()) {
            checkCurrentlyOverloaded(url, result);
            return result;
        }
        return null;
View Full Code Here

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
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.