@@ -615,7 +615,7 @@ public GitlabProject getProject(Serializable projectId) throws IOException {
615
615
* use namespace & project name to get project
616
616
*/
617
617
public GitlabProject getProject (String namespace , String projectName ) throws IOException {
618
- String tailUrl = GitlabProject .URL + "/" + namespace + "%2F" + projectName ;
618
+ String tailUrl = GitlabProject .URL + "/" + sanitizeGroupId ( namespace ) + "%2F" + sanitizeProjectId ( projectName ) ;
619
619
return retrieve ().to (tailUrl , GitlabProject .class );
620
620
}
621
621
@@ -1131,7 +1131,7 @@ public GitlabCommit cherryPick(GitlabProject project, String sha, String targetB
1131
1131
* @throws IOException on gitlab api call error
1132
1132
*/
1133
1133
public GitlabMergeRequest getMergeRequestByIid (Serializable projectId , Integer mergeRequestIid ) throws IOException {
1134
- String tailUrl = GitlabProject .URL + "/" + projectId + GitlabMergeRequest .URL + "/" + mergeRequestIid ;
1134
+ String tailUrl = GitlabProject .URL + "/" + sanitizeProjectId ( projectId ) + GitlabMergeRequest .URL + "/" + mergeRequestIid ;
1135
1135
return retrieve ().to (tailUrl , GitlabMergeRequest .class );
1136
1136
}
1137
1137
@@ -1283,7 +1283,7 @@ public List<GitlabCommit> getCommits(GitlabMergeRequest mergeRequest, Pagination
1283
1283
1284
1284
query .mergeWith (pagination .asQuery ());
1285
1285
1286
- String tailUrl = GitlabProject .URL + "/" + projectId +
1286
+ String tailUrl = GitlabProject .URL + "/" + sanitizeProjectId ( projectId ) +
1287
1287
"/repository" + GitlabCommit .URL + query .toString ();
1288
1288
1289
1289
GitlabCommit [] commits = retrieve ().to (tailUrl , GitlabCommit [].class );
@@ -1808,7 +1808,7 @@ public List<GitlabNote> getNotes(GitlabIssue issue) throws IOException {
1808
1808
}
1809
1809
1810
1810
public GitlabNote createNote (Serializable projectId , Integer issueId , String message ) throws IOException {
1811
- String tailUrl = GitlabProject .URL + "/" + projectId + GitlabIssue .URL
1811
+ String tailUrl = GitlabProject .URL + "/" + sanitizeProjectId ( projectId ) + GitlabIssue .URL
1812
1812
+ "/" + issueId + GitlabNote .URL ;
1813
1813
return dispatch ().with ("body" , message ).to (tailUrl , GitlabNote .class );
1814
1814
}
@@ -1826,8 +1826,9 @@ public GitlabNote createNote(GitlabIssue issue, String message) throws IOExcepti
1826
1826
* @throws IOException on gitlab api call error
1827
1827
*/
1828
1828
public void deleteNote (Serializable projectId , Integer issueId , GitlabNote noteToDelete ) throws IOException {
1829
- String tailUrl = GitlabProject .URL + "/" + projectId + GitlabIssue .URL + "/"
1830
- + issueId + GitlabNote .URL + "/" + noteToDelete .getId ();
1829
+ String tailUrl = GitlabProject .URL + "/" + sanitizeProjectId (projectId )
1830
+ + GitlabIssue .URL + "/" + issueId + GitlabNote .URL
1831
+ + "/" + noteToDelete .getId ();
1831
1832
retrieve ().method ("DELETE" ).to (tailUrl , GitlabNote .class );
1832
1833
}
1833
1834
@@ -1850,7 +1851,7 @@ public void deleteNote(GitlabIssue issue, GitlabNote noteToDelete) throws IOExce
1850
1851
*/
1851
1852
public List <GitlabLabel > getLabels (Serializable projectId )
1852
1853
throws IOException {
1853
- String tailUrl = GitlabProject .URL + "/" + projectId + GitlabLabel .URL ;
1854
+ String tailUrl = GitlabProject .URL + "/" + sanitizeProjectId ( projectId ) + GitlabLabel .URL ;
1854
1855
GitlabLabel [] labels = retrieve ().to (tailUrl , GitlabLabel [].class );
1855
1856
return Arrays .asList (labels );
1856
1857
}
@@ -1878,7 +1879,7 @@ public GitlabLabel createLabel(
1878
1879
Serializable projectId ,
1879
1880
String name ,
1880
1881
String color ) throws IOException {
1881
- String tailUrl = GitlabProject .URL + "/" + projectId + GitlabLabel .URL ;
1882
+ String tailUrl = GitlabProject .URL + "/" + sanitizeProjectId ( projectId ) + GitlabLabel .URL ;
1882
1883
return dispatch ().with ("name" , name )
1883
1884
.with ("color" , color )
1884
1885
.to (tailUrl , GitlabLabel .class );
@@ -1908,7 +1909,7 @@ public void deleteLabel(Serializable projectId, String name)
1908
1909
Query query = new Query ();
1909
1910
query .append ("name" , name );
1910
1911
String tailUrl = GitlabProject .URL + "/" +
1911
- projectId +
1912
+ sanitizeProjectId ( projectId ) +
1912
1913
GitlabLabel .URL +
1913
1914
query .toString ();
1914
1915
retrieve ().method ("DELETE" ).to (tailUrl , Void .class );
@@ -1938,7 +1939,7 @@ public GitlabLabel updateLabel(Serializable projectId,
1938
1939
String name ,
1939
1940
String newName ,
1940
1941
String newColor ) throws IOException {
1941
- String tailUrl = GitlabProject .URL + "/" + projectId + GitlabLabel .URL ;
1942
+ String tailUrl = GitlabProject .URL + "/" + sanitizeProjectId ( projectId ) + GitlabLabel .URL ;
1942
1943
GitlabHTTPRequestor requestor = retrieve ().method ("PUT" );
1943
1944
requestor .with ("name" , name );
1944
1945
if (newName != null ) {
@@ -1984,7 +1985,7 @@ public GitlabMilestone createMilestone(
1984
1985
String description ,
1985
1986
Date dueDate ,
1986
1987
Date startDate ) throws IOException {
1987
- String tailUrl = GitlabProject .URL + "/" + projectId + GitlabMilestone .URL ;
1988
+ String tailUrl = GitlabProject .URL + "/" + sanitizeProjectId ( projectId ) + GitlabMilestone .URL ;
1988
1989
GitlabHTTPRequestor requestor = dispatch ().with ("title" , title );
1989
1990
SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd" );
1990
1991
if (description != null ) {
@@ -2038,7 +2039,7 @@ public GitlabMilestone updateMilestone(
2038
2039
Date startDate ,
2039
2040
String stateEvent ) throws IOException {
2040
2041
String tailUrl = GitlabProject .URL + "/" +
2041
- projectId +
2042
+ sanitizeProjectId ( projectId ) +
2042
2043
GitlabMilestone .URL + "/" +
2043
2044
milestoneId ;
2044
2045
GitlabHTTPRequestor requestor = retrieve ().method ("PUT" );
0 commit comments