Package slash.navigation.rest

Examples of slash.navigation.rest.Put.addFile()


    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;
    }

    private Put updateCategory(String key, String name) throws IOException, JAXBException {
        return updateCategory(key, name, USERNAME, PASSWORD);
View Full Code Here


    }

    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;
    }

    protected Put updateUser(String key,
                             String userName, String password,
View Full Code Here

                             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;
    }


    @Test
View Full Code Here

        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;
    }

    private Put updateFile(int key, String fileName) throws IOException {
        return updateFile(key, fileName, USERNAME, PASSWORD);
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;
    }

    private Put updateRoute(int routeKey, String category, Integer fileKey, String description) throws IOException, JAXBException {
        return updateRoute(routeKey, category, fileKey, description, USERNAME, PASSWORD);
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.