Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from mixalturek/master
[JENKINS-22597] Error 404 when trying to access language details for "C/...
- Loading branch information
Showing
9 changed files
with
55 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package hudson.plugins.sloccount.util; | ||
|
||
import java.io.UnsupportedEncodingException; | ||
import java.net.URLEncoder; | ||
|
||
/** | ||
* HTML related utilities. | ||
* | ||
* @author Michal Turek | ||
*/ | ||
public class HtmlUtil { | ||
/** | ||
* Encode string so it can be used as URL. | ||
* | ||
* @param url | ||
* the input string | ||
* @return the string encoded as URL or the input string on error. | ||
* @see URLEncoder#encode(String, String) | ||
*/ | ||
public static String urlEncode(String url) { | ||
try { | ||
// "%20" instead of "+" to be compatible with decoder inside Jenkins | ||
// "C/C++ Header" -> "C%2FC%2B%2B+Header" -> "C/C+++Header" | ||
return URLEncoder.encode(url, "UTF-8").replace("+", "%20"); | ||
} catch (UnsupportedEncodingException e) { | ||
// Should never happen, UTF-8 should be always defined | ||
return url; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters