jenkinsci / java-client-api

A Jenkins API client for Java
MIT License
901 stars 470 forks source link

DisableJob function have a problem with Jobs inside folders #430

Open messelmanibrahim opened 4 years ago

messelmanibrahim commented 4 years ago

Hello,

If we have a Job inside a folder, EncodingUtils.encode(jobName) will transform backslash "/" character into "%2F" and thus job will not be found.

public void disableJob(String jobName, boolean crumbFlag) throws IOException { client.post("/job/" + EncodingUtils.encode(jobName) + "/disable", crumbFlag); }