public static void registerCnd(Repository repository,String workspace,String username,String password){
  try {
    Session session;
    if (username == null) {
      session=repository.login(workspace);
    }
 else {
      char pass[];
      if (password == null) {
        pass=new char[0];
      }
 else {
        pass=password.toCharArray();
      }
      session=repository.login(new SimpleCredentials(username,pass),workspace);
    }
    registerCnd(session);
    session.logout();
  }
 catch (  Exception e) {
    throw new RuntimeException("Unable to register cnd file",e);
  }
}

public static void registerCnd ( Repository repository , String workspace , String username , String password ) { try { Session session ; if ( username == null ) { session = repository . login ( workspace ) ; } else { char pass [ ] ; if ( password == null ) { pass = new char [ 0 ] ; } else { pass = password . toCharArray ( ) ; } session = repository . login ( new SimpleCredentials ( username , pass ) , workspace ) ; } registerCnd ( session ) ; session . logout ( ) ; } catch ( Exception e ) { throw new RuntimeException ( "Unable to register cnd file" , e ) ; } }
register the imap cnd file in the workspace
