Package slash.navigation.rest

Examples of slash.navigation.rest.Put


    private Put updateCategory(String key, String name,
                               String authenticationUserName, String authenticationPassword) throws IOException, JAXBException {
        String xml = createCategoryXml(name);

        Put request = new Put(CATEGORIES_URL + encodeUri(key) + GPX_URL_POSTFIX, new SimpleCredentials(authenticationUserName, authenticationPassword));
        request.addFile("file", writeToTempFile(xml));
        return request;
    }
View Full Code Here


    public void testUpdate() throws Exception {
        Post request1 = createCategory("Upload", "Interesting");
        request1.executeAsString();
        String key = parseCategoryKey(request1.getLocation());
        String newName = "Interesting" + System.currentTimeMillis();
        Put request2 = updateCategory(key, newName);
        String result2 = request2.executeAsString();
        assertEquals("category /Upload/" + newName + " updated", result2);
        assertEquals(201, request2.getStatusCode());
        assertTrue(request2.isSuccessful());
        String newKey = parseCategoryKey(request2.getLocation());
        HttpRequest request3 = readCategory(newKey);
        String result3 = request3.executeAsString();
        assertEquals(200, request3.getStatusCode());
        assertTrue(request3.isSuccessful());
        GpxType gpxType = GpxUtil.unmarshal11(result3);
View Full Code Here

        return new Get(USERS_URL + user + GPX_URL_POSTFIX);
    }

    private Put updateUser(String key, String fileName,
                           String authenticationUserName, String authenticationPassword) throws IOException {
        Put request = new Put(USERS_URL + key + GPX_URL_POSTFIX, new SimpleCredentials(authenticationUserName, authenticationPassword));
        request.addFile("file", new File(TEST_PATH + fileName));
        return request;
    }
View Full Code Here

    protected Put updateUser(String key,
                             String userName, String password,
                             String firstName, String lastName, String email,
                             String authenticationUserName, String authenticationPassword) throws IOException, JAXBException {
        String xml = createUserXml(userName, password, firstName, lastName, email);
        Put request = new Put(USERS_URL + key + GPX_URL_POSTFIX, new SimpleCredentials(authenticationUserName, authenticationPassword));
        request.addFile("file", xml.getBytes());
        return request;
    }
View Full Code Here

    private Get readFile(int key) {
        return new Get(FILES_URL + key + "/");
    }

    private Put updateFile(int key, String fileName, String authenticationUserName, String authenticationPassword) throws IOException {
        Put request = new Put(FILES_URL + key + "/", new SimpleCredentials(authenticationUserName, authenticationPassword));
        request.addFile("file", new File(TEST_PATH + fileName));
        return request;
    }
View Full Code Here

    }

    private Put updateRoute(int routeKey, String category, Integer fileKey, String description,
                            String authenticationUserName, String authenticationPassword) throws IOException, JAXBException {
        String xml = createRouteXml(category, fileKey, description);
        Put request = new Put(ROUTES_URL + routeKey + GPX_URL_POSTFIX, new SimpleCredentials(authenticationUserName, authenticationPassword));
        request.addFile("file", xml.getBytes());
        return request;
    }
View Full Code Here

TOP

Related Classes of slash.navigation.rest.Put

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.