Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Session fillParams() {//define some values for the connection string
- String rest_base = "http://<server>/sites/_api/web/";
- String repository_id = "c013ab76-4821-489f-9a1c-1d43bfce1c32";
- String atompub_url = rest_base + "/" + repository_id + "";
- String username ="notTobeShown";
- String password = "notTobeShown";
- SessionFactory factory = SessionFactoryImpl.newInstance();
- Map<String, String> parameter = new HashMap<String,String>();
- parameter.put(SessionParameter.ATOMPUB_URL, rest_base);
- parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
- parameter.put(SessionParameter.AUTH_HTTP_BASIC, "true");
- parameter.put(SessionParameter.USER, username);
- parameter.put(SessionParameter.PASSWORD, password);
- System.out.println("Pfft");
- List<Repository> repositories = factory.getRepositories(parameter);
- System.out.println("repositories: " + repositories.size());
- return repositories.get(0).createSession();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement