public static void main(String args[]) {
System.out.println(Hello.class.getName() + " started");
// Create a SessionFactory and set up the SessionParameter map
SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
Map<String, String> parameter = new HashMap<String, String>();
// connection settings - we're connecting to a public cmis repo,
// using the AtomPUB binding
parameter.put(SessionParameter.ATOMPUB_URL, " http://opencmis.cloudapp.net/inmemory/atom/");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
// find all the repositories at this URL - there should only be one.
List<Repository> repositories = new ArrayList<Repository>();
repositories = sessionFactory.getRepositories(parameter);
for (Repository r : repositories) {
System.out.println("Found repository: " + r.getName());
}
// create session with the first (and only) repository
Repository repository = repositories.get(0);
parameter.put(SessionParameter.REPOSITORY_ID, repository.getId());
Session session = sessionFactory.createSession(parameter);
System.out.println("Got a connection to repository: " + repository.getName() + ", with id: "
+ repository.getId());
// Get everything in the root folder and print the names of the objects