return session;
}
private Session getSessionByRMI(ConnectionInfo connectionInfo) {
Repository repository = new RMIRemoteRepository(connectionInfo.getRepositoryURL());
Session session = null;
try {
String workspaceName = connectionInfo.getWorkspaceName();
String username = connectionInfo.getUsername();
String password = connectionInfo.getPassword();
if (workspaceName == null || workspaceName.equals("") || workspaceName.equals("default")) {
session = repository.login(new SimpleCredentials(username, password.toCharArray()));
} else {
session = repository.login(new SimpleCredentials(username, password.toCharArray()),
workspaceName);
}
} catch (LoginException e) {
log.warn("Failed to get JCR session by RMIRemoteRepository");