I installed Alfresco Community v4.1 for use in my application. I want to access its contents (list files, add, delete etc.) using CMIS REST API. I don\'t find any e
You can use this method to access to your repository
try this worked fine for me
private static Session getSession(String serverUrl, String username, String password) {
SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
Map params = new HashMap();
params.put(SessionParameter.USER, username);
params.put(SessionParameter.PASSWORD, password);
params.put(SessionParameter.ATOMPUB_URL, serverUrl);
params.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
List repos = sessionFactory.getRepositories(params);
if (repos.isEmpty()) {
throw new RuntimeException("Server has no repositories!");
}
return repos.get(0).createSession();
}
This method get the session from your repository with your own informations
serverUrl : http://" + ipAlfresco + "/alfresco/api/-default-/public/cmis/versions/1.0/atom
username : admin
password : admin
Hope that helped you.