Unable to delete a project
I don't know if this issue belongs to subclipse solely or to Eclipse in general:
Whenever I delete a shared project in Eclipse and decide to remove the contents from disk the delete always fails. Even if I disconnect the project from SVN before and choose to delete the SVN meta data also, the delete fails with the following message:
Problems encountered while deleting resources.
Could not delete '/$project/.svn'.
Problems encountered while deleting resources.
Problems encountered while deleting files.
Could not delete: $project\.svn\pristine\08\08214986a7ef3b6935bb66e0a7690397a75af40e.svn-base.
etc.
Stacktrace:
Exception:java.nio.file.AccessDeniedException: $project\.svn\pristine\0e\0e68844594e3e7d02aa0e266bc625eb91fd9fc19.svn-base
at sun.nio.fs.WindowsException.translateToIOException(null:-1)
at sun.nio.fs.WindowsException.rethrowAsIOException(null:-1)
at sun.nio.fs.WindowsException.rethrowAsIOException(null:-1)
at sun.nio.fs.WindowsFileSystemProvider.implDelete(null:-1)
at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(null:-1)
at java.nio.file.Files.deleteIfExists(null:-1)
at org.eclipse.core.internal.filesystem.local.LocalFile.internalDelete(LocalFile.java:218)
at org.eclipse.core.internal.filesystem.local.LocalFile.internalDelete(LocalFile.java:238)
at org.eclipse.core.internal.filesystem.local.LocalFile.internalDelete(LocalFile.java:238)
at org.eclipse.core.internal.filesystem.local.LocalFile.internalDelete(LocalFile.java:238)
at org.eclipse.core.internal.filesystem.local.LocalFile.delete(LocalFile.java:136)
at org.eclipse.core.internal.localstore.DeleteVisitor.delete(DeleteVisitor.java:63)
at org.eclipse.core.internal.localstore.DeleteVisitor.visit(DeleteVisitor.java:151)
at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:111)
at org.eclipse.core.internal.localstore.FileSystemResourceManager.delete(FileSystemResourceManager.java:367)
at org.eclipse.core.internal.resources.ResourceTree.internalDeleteFolder(ResourceTree.java:358)
at org.eclipse.core.internal.resources.ResourceTree.internalDeleteProject(ResourceTree.java:393)
at org.eclipse.core.internal.resources.ResourceTree.standardDeleteProject(ResourceTree.java:850)
at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1836)
at org.eclipse.core.internal.resources.Resource.delete(Resource.java:782)
at org.eclipse.core.internal.resources.Project.delete(Project.java:318)
at org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange.perform(DeleteResourceChange.java:155)
at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:280)
at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:280)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation$1.run(PerformChangeOperation.java:257)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:305)
at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:96)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:216)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:86)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
If it helps to narrow things down, I'm on Windows (8.1) and have TortoiseSVN installed as well.
Current workaround is to delete the project via file explorer (any problems here).
This does not look like a Subclipse or Eclipse issue. It seems to be a FS permission problem to the file. If you were on Linux, I would guess you ran a command as root so file was set to be owned by root and cannot be removed. You are obviously on Windows, but it looks to be a similar type problem where you must have done some operation in the past as a different account. So when SVN created this file in the pristine data store it is owned by a user other than your normal account and you cannot remove it. There is no possible way to get around this problem from a SVN client once it exists.
The thing is that rmdir /S /Q on the command line and manual deletion via file explorer works like a charm. It's only Eclipse that struggles to delete the project and it's contents on disk, namely the meta data files under .svn.
Deleting the meta data files via Team -> Disconnect ... prior to deleting the project has no benefit either. In fact, the .svn folder and files underneath are still present. That's a bit strange because I expected those files to be removed by the disconnect. More over no issues are shown in Eclipse's error log while disconnecting.
If I delete the .svn folder manually in Windows' file explorer and then delete the project in Eclipse everything is fine.
I can exclude file system permission as I am the only user on the system and therefore I own all files and permissions.
Deleting the meta data files via Team -> Disconnect ... prior to deleting the project has no benefit either. In fact, the .svn folder and files underneath are still present. [...] More over no issues are shown in Eclipse's error log while disconnecting.
Hm, looks like LocalFolder.getSVNFolders(IProgressMonitor monitor, final boolean unmanage) doesn't report any issues encountered while deleting meta data files:
if (unmanage) {
try {
svnFolder.delete(true, null);
} catch (CoreException e) {}
}
According to the Javadoc of IResource a CoreException is thrown if the resource cannot be deleted for some reason or the change is disallowed.