The incremental builder does not handle deletions in its current implementation. To handle deletion, IResourceDelta
needs to be inspected to find out what kind of delta took place, and the delete handled accordingly.
Perform the following steps:
Run the Eclipse instance and delete a
.minimark
file. An exception is thrown and reported to the user:To fix this issue, modify the check in
MinimarkVisitor
class'processResource()
method to see if the resource exists or not:private void processResource(IResource resource) throwsCoreException { if (resource instanceof IFile && resource.exists()) {
This solves the
NullPointerException
, but the generated HTML file is left behind. To clean up the associated.html
file if the.minimark
file is being deleted, the resource delta's flags can be inspected to see if it is deleted, and if so, the corresponding HTML file can be deleted as well. Modify thevisit(
IResourceDelta)
method as follows:public boolean visit...