- String msg = "Your are about to clear workspace [" + workspaceName
- + "].\n Do you really want to proceed ?";
-
- boolean result = MessageDialog.openConfirm(DistPlugin.getDefault()
- .getWorkbench().getDisplay().getActiveShell(),
- "Confirm workspace clear", msg);
- if (result) {
- Session session = null;
- try {
- session = repository.login(workspaceName);
+
+ Session nodeSession = null;
+ Session session = null;
+
+ try {
+ nodeSession = nodeRepository.login();
+ Node repoNode = nodeSession.getNode(targetRepoPath);
+ Repository repository = RepoUtils.getRepository(repositoryFactory,
+ keyring, repoNode);
+ Credentials credentials = RepoUtils.getRepositoryCredentials(
+ keyring, repoNode);
+
+ String msg = "Your are about to completely delete workspace ["
+ + workspaceName + "].\n Do you really want to proceed ?";
+ boolean result = MessageDialog.openConfirm(DistPlugin.getDefault()
+ .getWorkbench().getDisplay().getActiveShell(),
+ "Confirm workspace deletion", msg);
+
+ if (result) {
+ // msg =
+ // "There is no possible turning back, are your REALLY sure you want to proceed ?";
+ msg = "WARNING: \nCurrent Jackrabbit version used does "
+ + "not support workspace management.\n"
+ + "Thus, the workspace will only be cleaned so "
+ + "that you can launch fetch process again.\n\n"
+ + "Do you still want to proceed ?";
+ result = MessageDialog.openConfirm(DistPlugin.getDefault()
+ .getWorkbench().getDisplay().getActiveShell(),
+ "Confirm workspace deletion", msg);
+ }
+
+ if (result) {
+ session = repository.login(credentials, workspaceName);
+
+ // TODO use this with a newer version of Jackrabbit
+ // Workspace wsp = session.getWorkspace();
+ // wsp.deleteWorkspace(workspaceName);
+