Package slash.navigation.rest

Examples of slash.navigation.rest.SimpleCredentials


public class CategoryIT extends RouteCatalogClientBase {

    private Post createCategoryFromFile(String fileName,
                                        String authenticationUserName, String authenticationPassword) throws IOException {
        Post request = new Post(CATEGORIES_URL, new SimpleCredentials(authenticationUserName, authenticationPassword));
        request.addFile("file", new File(TEST_PATH + fileName));
        return request;
    }
View Full Code Here


    private Post createCategory(String parent, String name,
                                String authenticationUserName, String authenticationPassword) throws IOException, JAXBException {
        String xml = createCategoryXml(name);

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

    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

    protected RemoteCatalog catalog;

    @Before
    public void setUp() throws Exception {
        super.setUp();
        catalog = new RemoteCatalog(CATALOG, new SimpleCredentials(USERNAME, PASSWORD));
    }
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 updateFile(int key, String fileName) throws IOException {
        return updateFile(key, fileName, USERNAME, PASSWORD);
    }

    private Delete deleteFile(int key,  String authenticationUserName, String authenticationPassword) {
        return new Delete(FILES_URL + key + "/", new SimpleCredentials(authenticationUserName, authenticationPassword));
    }
View Full Code Here

        return toXml(gpxType);
    }


    protected Delete deleteCategory(String key, String authenticationUserName, String authenticationPassword) {
        return new Delete(CATEGORIES_URL + key + GPX_URL_POSTFIX, new SimpleCredentials(authenticationUserName, authenticationPassword));
    }
View Full Code Here


    protected Post createRoute(String category, Integer fileKey, String description,
                               String authenticationUserName, String authenticationPassword) throws IOException, JAXBException {
        String xml = createRouteXml(category, fileKey, description);
        Post request = new Post(ROUTES_URL, new SimpleCredentials(authenticationUserName, authenticationPassword));
        request.addFile("file", xml.getBytes());
        return request;
    }
View Full Code Here

TOP

Related Classes of slash.navigation.rest.SimpleCredentials

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.