Clear out the "oldPlugins" cache folder if jars are over a certain age

Issue #4 open
Will Warren repo owner created an issue

When SwiftApi updates a plugin, it moves the old plugin to the plugins/SwiftApi/oldPlugins folder with names like this:

$ ls plugins/SwiftApi/oldPlugins
SwiftApi_1-5-1379423021322.jar.old
Vault_1-2-25-b333-1379431690538.jar.old
Vault_1-2-27-b349-1379431639422.jar.old

The format is <pluginname>-<unix timestamp>.jar.old. It should be relatively easy to pull out the unix timestamp and subtract it from the current unix timestamp. If the difference is greater than some value (new config parameter?), then on startup (onEnabled) it should go through these files and delete them.

Comments (1)

  1. Log in to comment