public void execute()

in src/main/java/org/apache/sling/installer/factory/model/impl/UninstallModelTask.java [41:61]


    public void execute(final InstallationContext ctx) {
        try {
            final OsgiInstaller installer = this.getService(OsgiInstaller.class);
            if ( installer == null ) {
                ctx.log("Unable to get OSGi Installer service!");
            } else {
                final TaskResource resource = this.getResource();
                ctx.log("Uninstalling {}", resource.getEntityId());
                installer.registerResources("model-" + resource.getAttribute(ModelTransformer.ATTR_FEATURE_NAME), null);
                final String path = (String)resource.getAttribute(ModelTransformer.ATTR_BASE_PATH);
                if ( path != null ) {
                    final File dir = new File(path);
                    deleteDirectory(dir);
                }
                this.getResourceGroup().setFinishState(ResourceState.UNINSTALLED);
                ctx.log("Uninstalled {}", resource.getEntityId());
            }
        } finally {
            this.cleanup();
        }
    }