I am trying to connect alfresco using config parameters but i am getting error:
Config: sessionParameters.put(SessionParameter.USER, \"admin\");
sessionParam
Use the following method to get session
public Session getSession() {
if (session == null) {
logger.info("Not connected, creating new connection");
// default factory implementation
SessionFactory factory = SessionFactoryImpl.newInstance();
Map parameter = new HashMap();
// user credentials
parameter.put(SessionParameter.USER, "admin");
parameter.put(SessionParameter.PASSWORD, "admin");
// connection settings
parameter.put(SessionParameter.ATOMPUB_URL, "http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
List repositories = factory.getRepositories(parameter);
if (repositories != null && repositories.size() > 0) {
logger.info("Found (" + repositories.size() + ") Alfresco repositories");
this.session = repositories.get(0).createSession();
} else {
throw new CmisConnectionException("Could not connect to the Alfresco Server,"
+ " no repository found!");
}
}
return this.session;
}