Delete a style with parameter purge=true can't delete the sld.bak file

When I delete a style by http delete with parameter purge=true (styleDelete method in StyleController Class).In the code,the remove method have already renamed the sld file to sld.bak,but the parameter purge still try to delete the orgin sld file,so the sld.bak can’t be deleted. I think this is a bug to repaire.

        catalog.remove(style);
        catalog.getResourcePool().deleteStyle(style, purge);

Hi @haiming08 and welcome to the geoserver community, thanks for joining us here.

Huh - the step to “rename” and then delete was one of the ways to address windows file locking problems.

I do not see the issue reported, only the original Jira ticket when deleting the SLD file was added.

As this is the developer forum, can I confirm you are in position to make a fix to deleteStyle?

There are instructions online, a key step is to make a test case so we can confirm the fix is functional (or does not cause a regression).