[JENKINS-13909] don't keep legacy *.hpi when uploading a plugin

even jenkins takes care to load jpi first, this is confusing
This commit is contained in:
Nicolas De Loof committed 2012-06-01 17:16:10 +02:00
1 parent 91b3d3c544
commit de5938b3a6
1 file changed
+1
@@ -704,6 +704,7 @@ public abstract class PluginManager extends AbstractModelObject {
throw new Failure(hudson.model.Messages.Hudson_NotAPlugin(fileName));
}
final String baseName = FilenameUtils.getBaseName(fileName);
new File(rootDir, baseName + ".hpi").delete(); // don't keep confusing legacy *.hpi
fileItem.write(new File(rootDir, baseName + ".jpi")); // rename all new plugins to *.jpi
fileItem.delete();