Commit 9095a622 authored by Chen Yiran's avatar Chen Yiran Committed by Tim Olshansky

add getProject method via namespace and project name (#191)

parent 97c80dbb
package org.gitlab.api;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.gitlab.api.http.GitlabHTTPRequestor;
import org.gitlab.api.http.Query;
import org.gitlab.api.models.*;
import java.io.*;
import java.net.URL;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
......@@ -13,20 +15,6 @@ import java.util.Arrays;
import java.util.Date;
import java.util.List;
import org.gitlab.api.http.GitlabHTTPRequestor;
import org.gitlab.api.http.Query;
import org.gitlab.api.models.*;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.gitlab.api.http.GitlabHTTPRequestor;
import org.gitlab.api.http.Query;
import org.gitlab.api.models.*;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
/**
* Gitlab API Wrapper class
......@@ -581,6 +569,14 @@ public class GitlabAPI {
return retrieve().to(tailUrl, GitlabProject.class);
}
/**
* use namespace & project name to get project
*/
public GitlabProject getProject(String namespace, String projectName) throws IOException{
String tailUrl = GitlabProject.URL + "/" + namespace + "%2F" + projectName;
return retrieve().to(tailUrl, GitlabProject.class);
}
/**
*
* Get a list of projects accessible by the authenticated user.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment