MapWorkspace original = repository.getWorkspace(nameOfWorkspaceToBeCloned);
MapWorkspace target = repository.getWorkspace(targetWorkspaceName);
if (target != null) {
String msg = GraphI18n.workspaceAlreadyExistsInRepository.text(targetWorkspaceName, repository.getSourceName());
request.setError(new InvalidWorkspaceException(msg));
return;
}
if (original == null) {
switch (request.cloneConflictBehavior()) {
case DO_NOT_CLONE:
String msg = GraphI18n.workspaceDoesNotExistInRepository.text(nameOfWorkspaceToBeCloned,
repository.getSourceName());
request.setError(new InvalidWorkspaceException(msg));
return;
case SKIP_CLONE:
target = repository.createWorkspace(context, targetWorkspaceName, request.targetConflictBehavior());
assert target != null;