File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed
src/main/java/org/gitlab4j/api Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change 22
33import java .io .File ;
44import java .net .URL ;
5- import java .net .URLEncoder ;
65
76import javax .ws .rs .NotAuthorizedException ;
87import javax .ws .rs .core .Form ;
1413import org .gitlab4j .api .models .Group ;
1514import org .gitlab4j .api .models .Project ;
1615import org .gitlab4j .api .models .User ;
16+ import org .gitlab4j .api .utils .UrlEncoder ;
1717
1818/**
1919 * This class is the base class for all the sub API classes. It provides implementations of
@@ -162,18 +162,7 @@ protected GitLabApiClient getApiClient() {
162162 * @throws GitLabApiException if encoding throws an exception
163163 */
164164 protected String urlEncode (String s ) throws GitLabApiException {
165- try {
166- String encoded = URLEncoder .encode (s , "UTF-8" );
167- // Since the encode method encodes plus signs as %2B,
168- // we can simply replace the encoded spaces with the correct encoding here
169- encoded = encoded .replace ("+" , "%20" );
170- encoded = encoded .replace ("." , "%2E" );
171- encoded = encoded .replace ("-" , "%2D" );
172- encoded = encoded .replace ("_" , "%5F" );
173- return (encoded );
174- } catch (Exception e ) {
175- throw new GitLabApiException (e );
176- }
165+ return (UrlEncoder .urlEncode (s ));
177166 }
178167
179168 /**
You can’t perform that action at this time.
0 commit comments