Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
d80e4b15
Commit
d80e4b15
authored
Mar 12, 2014
by
Greg Messner
Browse files
Added put() methods.
parent
b3843101
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/messners/gitlab/api/AbstractApi.java
View file @
d80e4b15
...
@@ -89,6 +89,41 @@ public abstract class AbstractApi {
...
@@ -89,6 +89,41 @@ public abstract class AbstractApi {
}
}
/**
* Perform an HTTP PUT call with the specified form data and path objects, returning
* a ClientResponse instance with the data returned from the endpoint.
*
* @param queryParams
* @param pathArgs
* @return a ClientResponse instance with the data returned from the endpoint
* @throws UniformInterfaceException
* @throws ClientHandlerException
* @throws IOException
*/
protected
ClientResponse
put
(
MultivaluedMap
<
String
,
String
>
queryParams
,
Object
...
pathArgs
)
throws
UniformInterfaceException
,
ClientHandlerException
,
IOException
{
return
(
getApiClient
().
put
(
queryParams
,
pathArgs
));
}
/**
* Perform an HTTP PUT call with the specified form data and URL, returning
* a ClientResponse instance with the data returned from the endpoint.
*
* @param queryParams
* @param url
* @return a ClientResponse instance with the data returned from the endpoint
* @throws UniformInterfaceException
* @throws ClientHandlerException
*/
protected
ClientResponse
put
(
MultivaluedMap
<
String
,
String
>
queryParams
,
URL
url
)
throws
UniformInterfaceException
,
ClientHandlerException
{
return
(
getApiClient
().
put
(
queryParams
,
url
));
}
/**
/**
* Perform an HTTP DELETE call with the specified form data and path objects, returning
* Perform an HTTP DELETE call with the specified form data and path objects, returning
* a ClientResponse instance with the data returned from the endpoint.
* a ClientResponse instance with the data returned from the endpoint.
...
@@ -117,8 +152,7 @@ public abstract class AbstractApi {
...
@@ -117,8 +152,7 @@ public abstract class AbstractApi {
* @throws ClientHandlerException
* @throws ClientHandlerException
*/
*/
protected
ClientResponse
delete
(
MultivaluedMap
<
String
,
String
>
queryParams
,
URL
url
)
protected
ClientResponse
delete
(
MultivaluedMap
<
String
,
String
>
queryParams
,
URL
url
)
throws
UniformInterfaceException
,
ClientHandlerException
{
throws
UniformInterfaceException
,
ClientHandlerException
{
return
(
getApiClient
().
delete
(
queryParams
,
url
));
return
(
getApiClient
().
delete
(
queryParams
,
url
));
}
}
...
...
src/main/java/com/messners/gitlab/api/GitLabApiClient.java
View file @
d80e4b15
...
@@ -279,6 +279,52 @@ public class GitLabApiClient {
...
@@ -279,6 +279,52 @@ public class GitLabApiClient {
}
}
/**
* Perform an HTTP PUT call with the specified form data and path objects, returning
* a ClientResponse instance with the data returned from the endpoint.
*
* @param queryParams
* @param pathArgs
* @return a ClientResponse instance with the data returned from the endpoint
* @throws UniformInterfaceException
* @throws ClientHandlerException
* @throws IOException
*/
protected
ClientResponse
put
(
MultivaluedMap
<
String
,
String
>
queryParams
,
Object
...
pathArgs
)
throws
UniformInterfaceException
,
ClientHandlerException
,
IOException
{
URL
url
=
getApiUrl
(
pathArgs
);
return
(
put
(
queryParams
,
url
));
}
/**
* Perform an HTTP PUT call with the specified form data and URL, returning
* a ClientResponse instance with the data returned from the endpoint.
*
* @param queryParams
* @param url
* @return a ClientResponse instance with the data returned from the endpoint
* @throws UniformInterfaceException
* @throws ClientHandlerException
*/
protected
ClientResponse
put
(
MultivaluedMap
<
String
,
String
>
queryParams
,
URL
url
)
throws
UniformInterfaceException
,
ClientHandlerException
{
if
(
apiClient
==
null
)
{
apiClient
=
Client
.
create
(
clientConfig
);
}
WebResource
resource
=
apiClient
.
resource
(
url
.
toString
());
if
(
queryParams
!=
null
)
{
resource
.
queryParams
(
queryParams
);
}
return
(
resource
.
header
(
PRIVATE_TOKEN_HEADER
,
privateToken
)
.
accept
(
MediaType
.
APPLICATION_JSON
)
.
put
(
ClientResponse
.
class
));
}
/**
/**
* Perform an HTTP DELETE call with the specified form data and path objects, returning
* Perform an HTTP DELETE call with the specified form data and path objects, returning
* a ClientResponse instance with the data returned from the endpoint.
* a ClientResponse instance with the data returned from the endpoint.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment