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
0cb325a0
Commit
0cb325a0
authored
Aug 21, 2024
by
佳 邓
Browse files
change javax to jakarta
parent
c81635c4
Changes
77
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/ProtectedBranchesApi.java
View file @
0cb325a0
...
@@ -4,8 +4,8 @@ import java.util.List;
...
@@ -4,8 +4,8 @@ import java.util.List;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
ja
vax
.ws.rs.core.Form
;
import
ja
karta
.ws.rs.core.Form
;
import
ja
vax
.ws.rs.core.Response
;
import
ja
karta
.ws.rs.core.Response
;
import
org.gitlab4j.api.models.AccessLevel
;
import
org.gitlab4j.api.models.AccessLevel
;
import
org.gitlab4j.api.models.AllowedTo
;
import
org.gitlab4j.api.models.AllowedTo
;
...
...
src/main/java/org/gitlab4j/api/ReleasesApi.java
View file @
0cb325a0
...
@@ -4,7 +4,7 @@ import java.util.List;
...
@@ -4,7 +4,7 @@ import java.util.List;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
ja
vax
.ws.rs.core.Response
;
import
ja
karta
.ws.rs.core.Response
;
import
org.gitlab4j.api.models.Release
;
import
org.gitlab4j.api.models.Release
;
import
org.gitlab4j.api.models.ReleaseParams
;
import
org.gitlab4j.api.models.ReleaseParams
;
...
...
src/main/java/org/gitlab4j/api/RepositoryApi.java
View file @
0cb325a0
...
@@ -10,11 +10,11 @@ import java.util.List;
...
@@ -10,11 +10,11 @@ import java.util.List;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
ja
vax
.ws.rs.core.Form
;
import
ja
karta
.ws.rs.core.Form
;
import
ja
vax
.ws.rs.core.GenericType
;
import
ja
karta
.ws.rs.core.GenericType
;
import
ja
vax
.ws.rs.core.MediaType
;
import
ja
karta
.ws.rs.core.MediaType
;
import
ja
vax
.ws.rs.core.MultivaluedMap
;
import
ja
karta
.ws.rs.core.MultivaluedMap
;
import
ja
vax
.ws.rs.core.Response
;
import
ja
karta
.ws.rs.core.Response
;
import
org.gitlab4j.api.GitLabApi.ApiVersion
;
import
org.gitlab4j.api.GitLabApi.ApiVersion
;
import
org.gitlab4j.api.models.Branch
;
import
org.gitlab4j.api.models.Branch
;
...
...
src/main/java/org/gitlab4j/api/RepositoryFileApi.java
View file @
0cb325a0
...
@@ -9,9 +9,9 @@ import java.util.List;
...
@@ -9,9 +9,9 @@ import java.util.List;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
ja
vax
.ws.rs.core.Form
;
import
ja
karta
.ws.rs.core.Form
;
import
ja
vax
.ws.rs.core.MediaType
;
import
ja
karta
.ws.rs.core.MediaType
;
import
ja
vax
.ws.rs.core.Response
;
import
ja
karta
.ws.rs.core.Response
;
import
org.gitlab4j.api.GitLabApi.ApiVersion
;
import
org.gitlab4j.api.GitLabApi.ApiVersion
;
import
org.gitlab4j.api.models.Blame
;
import
org.gitlab4j.api.models.Blame
;
...
@@ -515,4 +515,4 @@ public class RepositoryFileApi extends AbstractApi {
...
@@ -515,4 +515,4 @@ public class RepositoryFileApi extends AbstractApi {
public
Stream
<
Blame
>
getBlameStream
(
Object
projectIdOrPath
,
String
filePath
,
String
ref
)
throws
GitLabApiException
{
public
Stream
<
Blame
>
getBlameStream
(
Object
projectIdOrPath
,
String
filePath
,
String
ref
)
throws
GitLabApiException
{
return
(
getBlame
(
projectIdOrPath
,
filePath
,
ref
,
getDefaultPerPage
()).
stream
());
return
(
getBlame
(
projectIdOrPath
,
filePath
,
ref
,
getDefaultPerPage
()).
stream
());
}
}
}
}
\ No newline at end of file
src/main/java/org/gitlab4j/api/ResourceLabelEventsApi.java
View file @
0cb325a0
...
@@ -4,7 +4,7 @@ import java.util.List;
...
@@ -4,7 +4,7 @@ import java.util.List;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
ja
vax
.ws.rs.core.Response
;
import
ja
karta
.ws.rs.core.Response
;
import
org.gitlab4j.api.models.LabelEvent
;
import
org.gitlab4j.api.models.LabelEvent
;
...
...
src/main/java/org/gitlab4j/api/RunnersApi.java
View file @
0cb325a0
...
@@ -3,8 +3,8 @@ package org.gitlab4j.api;
...
@@ -3,8 +3,8 @@ package org.gitlab4j.api;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
ja
vax
.ws.rs.core.GenericType
;
import
ja
karta
.ws.rs.core.GenericType
;
import
ja
vax
.ws.rs.core.Response
;
import
ja
karta
.ws.rs.core.Response
;
import
org.gitlab4j.api.models.Job
;
import
org.gitlab4j.api.models.Job
;
import
org.gitlab4j.api.models.JobStatus
;
import
org.gitlab4j.api.models.JobStatus
;
...
...
src/main/java/org/gitlab4j/api/ServicesApi.java
View file @
0cb325a0
...
@@ -10,8 +10,8 @@ import org.gitlab4j.api.services.JiraService;
...
@@ -10,8 +10,8 @@ import org.gitlab4j.api.services.JiraService;
import
org.gitlab4j.api.services.MattermostService
;
import
org.gitlab4j.api.services.MattermostService
;
import
org.gitlab4j.api.services.SlackService
;
import
org.gitlab4j.api.services.SlackService
;
import
ja
vax
.ws.rs.core.Form
;
import
ja
karta
.ws.rs.core.Form
;
import
ja
vax
.ws.rs.core.Response
;
import
ja
karta
.ws.rs.core.Response
;
/**
/**
* Access for the services API. Currently only the gitlab-ci, HipChatService, Slack, and JIRA service are supported.
* Access for the services API. Currently only the gitlab-ci, HipChatService, Slack, and JIRA service are supported.
...
...
src/main/java/org/gitlab4j/api/SnippetsApi.java
View file @
0cb325a0
...
@@ -4,8 +4,8 @@ import java.util.List;
...
@@ -4,8 +4,8 @@ import java.util.List;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
ja
vax
.ws.rs.core.GenericType
;
import
ja
karta
.ws.rs.core.GenericType
;
import
ja
vax
.ws.rs.core.Response
;
import
ja
karta
.ws.rs.core.Response
;
import
org.gitlab4j.api.models.Snippet
;
import
org.gitlab4j.api.models.Snippet
;
import
org.gitlab4j.api.models.Visibility
;
import
org.gitlab4j.api.models.Visibility
;
...
...
src/main/java/org/gitlab4j/api/SystemHooksApi.java
View file @
0cb325a0
...
@@ -3,8 +3,8 @@ package org.gitlab4j.api;
...
@@ -3,8 +3,8 @@ package org.gitlab4j.api;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
ja
vax
.ws.rs.core.GenericType
;
import
ja
karta
.ws.rs.core.GenericType
;
import
ja
vax
.ws.rs.core.Response
;
import
ja
karta
.ws.rs.core.Response
;
import
org.gitlab4j.api.GitLabApi.ApiVersion
;
import
org.gitlab4j.api.GitLabApi.ApiVersion
;
import
org.gitlab4j.api.models.SystemHook
;
import
org.gitlab4j.api.models.SystemHook
;
...
...
src/main/java/org/gitlab4j/api/TagsApi.java
View file @
0cb325a0
...
@@ -6,9 +6,9 @@ import java.util.List;
...
@@ -6,9 +6,9 @@ import java.util.List;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
ja
vax
.ws.rs.core.Form
;
import
ja
karta
.ws.rs.core.Form
;
import
ja
vax
.ws.rs.core.GenericType
;
import
ja
karta
.ws.rs.core.GenericType
;
import
ja
vax
.ws.rs.core.Response
;
import
ja
karta
.ws.rs.core.Response
;
import
org.gitlab4j.api.GitLabApi.ApiVersion
;
import
org.gitlab4j.api.GitLabApi.ApiVersion
;
import
org.gitlab4j.api.models.AccessLevel
;
import
org.gitlab4j.api.models.AccessLevel
;
...
...
src/main/java/org/gitlab4j/api/TodosApi.java
View file @
0cb325a0
...
@@ -3,7 +3,7 @@ package org.gitlab4j.api;
...
@@ -3,7 +3,7 @@ package org.gitlab4j.api;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
ja
vax
.ws.rs.core.Response
;
import
ja
karta
.ws.rs.core.Response
;
import
org.gitlab4j.api.models.Todo
;
import
org.gitlab4j.api.models.Todo
;
...
...
src/main/java/org/gitlab4j/api/UserApi.java
View file @
0cb325a0
...
@@ -7,9 +7,9 @@ import java.util.Objects;
...
@@ -7,9 +7,9 @@ import java.util.Objects;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
ja
vax
.ws.rs.core.Form
;
import
ja
karta
.ws.rs.core.Form
;
import
ja
vax
.ws.rs.core.GenericType
;
import
ja
karta
.ws.rs.core.GenericType
;
import
ja
vax
.ws.rs.core.Response
;
import
ja
karta
.ws.rs.core.Response
;
import
org.gitlab4j.api.GitLabApi.ApiVersion
;
import
org.gitlab4j.api.GitLabApi.ApiVersion
;
import
org.gitlab4j.api.models.CustomAttribute
;
import
org.gitlab4j.api.models.CustomAttribute
;
...
...
src/main/java/org/gitlab4j/api/WikisApi.java
View file @
0cb325a0
...
@@ -30,8 +30,8 @@ import java.util.List;
...
@@ -30,8 +30,8 @@ import java.util.List;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
ja
vax
.ws.rs.core.GenericType
;
import
ja
karta
.ws.rs.core.GenericType
;
import
ja
vax
.ws.rs.core.Response
;
import
ja
karta
.ws.rs.core.Response
;
import
org.gitlab4j.api.models.WikiAttachment
;
import
org.gitlab4j.api.models.WikiAttachment
;
import
org.gitlab4j.api.models.WikiPage
;
import
org.gitlab4j.api.models.WikiPage
;
...
@@ -131,7 +131,7 @@ public class WikisApi extends AbstractApi {
...
@@ -131,7 +131,7 @@ public class WikisApi extends AbstractApi {
*/
*/
public
Pager
<
WikiPage
>
getPages
(
Object
projectIdOrPath
,
boolean
withContent
,
int
itemsPerPage
)
throws
GitLabApiException
{
public
Pager
<
WikiPage
>
getPages
(
Object
projectIdOrPath
,
boolean
withContent
,
int
itemsPerPage
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
new
GitLabApiForm
().
withParam
(
"with_content"
,
(
withContent
?
1
:
0
));
GitLabApiForm
formData
=
new
GitLabApiForm
().
withParam
(
"with_content"
,
(
withContent
?
1
:
0
));
return
(
new
Pager
<
WikiPage
>(
this
,
WikiPage
.
class
,
itemsPerPage
,
formData
.
asMap
(),
return
(
new
Pager
<
WikiPage
>(
this
,
WikiPage
.
class
,
itemsPerPage
,
formData
.
asMap
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"wikis"
));
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"wikis"
));
}
}
...
...
src/main/java/org/gitlab4j/api/systemhooks/SystemHookManager.java
View file @
0cb325a0
...
@@ -7,7 +7,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
...
@@ -7,7 +7,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import
java.util.logging.Level
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
java.util.logging.Logger
;
import
ja
vax
.servlet.http.HttpServletRequest
;
import
ja
karta
.servlet.http.HttpServletRequest
;
import
org.gitlab4j.api.GitLabApiException
;
import
org.gitlab4j.api.GitLabApiException
;
import
org.gitlab4j.api.HookManager
;
import
org.gitlab4j.api.HookManager
;
...
@@ -181,7 +181,7 @@ public class SystemHookManager implements HookManager {
...
@@ -181,7 +181,7 @@ public class SystemHookManager implements HookManager {
/**
/**
* Verifies the provided Event and fires it off to the registered listeners.
* Verifies the provided Event and fires it off to the registered listeners.
*
*
* @param event the Event instance to handle
* @param event the Event instance to handle
* @throws GitLabApiException if the event is not supported
* @throws GitLabApiException if the event is not supported
*/
*/
...
@@ -217,7 +217,7 @@ public class SystemHookManager implements HookManager {
...
@@ -217,7 +217,7 @@ public class SystemHookManager implements HookManager {
/**
/**
* Fire the event to the registered listeners.
* Fire the event to the registered listeners.
*
*
* @param event the SystemHookEvent instance to fire to the registered event listeners
* @param event the SystemHookEvent instance to fire to the registered event listeners
* @throws GitLabApiException if the event is not supported
* @throws GitLabApiException if the event is not supported
*/
*/
...
...
src/main/java/org/gitlab4j/api/utils/FileUtils.java
View file @
0cb325a0
...
@@ -8,7 +8,7 @@ import java.nio.file.Files;
...
@@ -8,7 +8,7 @@ import java.nio.file.Files;
import
java.util.Base64
;
import
java.util.Base64
;
import
java.util.Scanner
;
import
java.util.Scanner
;
import
ja
vax
.ws.rs.core.Response
;
import
ja
karta
.ws.rs.core.Response
;
import
org.gitlab4j.api.Constants.Encoding
;
import
org.gitlab4j.api.Constants.Encoding
;
...
@@ -21,7 +21,7 @@ public class FileUtils {
...
@@ -21,7 +21,7 @@ public class FileUtils {
* Creates a File that is unique in the specified directory. If the specified
* Creates a File that is unique in the specified directory. If the specified
* filename exists in the directory, "-#" will be appended to the filename until
* filename exists in the directory, "-#" will be appended to the filename until
* a unique filename can be created.
* a unique filename can be created.
*
*
* @param directory the directory to create the file in
* @param directory the directory to create the file in
* @param filename the base filename with extension
* @param filename the base filename with extension
* @return a File that is unique in the specified directory
* @return a File that is unique in the specified directory
...
@@ -53,7 +53,7 @@ public class FileUtils {
...
@@ -53,7 +53,7 @@ public class FileUtils {
/**
/**
* Get the filename from the "Content-Disposition" header of a JAX-RS response.
* Get the filename from the "Content-Disposition" header of a JAX-RS response.
*
*
* @param response the JAX-RS Response instance to get the "Content-Disposition" header filename from
* @param response the JAX-RS Response instance to get the "Content-Disposition" header filename from
* @return the filename from the "Content-Disposition" header of a JAX-RS response, or null
* @return the filename from the "Content-Disposition" header of a JAX-RS response, or null
* if the "Content-Disposition" header is not present in the response
* if the "Content-Disposition" header is not present in the response
...
@@ -66,10 +66,10 @@ public class FileUtils {
...
@@ -66,10 +66,10 @@ public class FileUtils {
return
(
disposition
.
replaceFirst
(
"(?i)^.*filename=\"([^\"]+)\".*$"
,
"$1"
));
return
(
disposition
.
replaceFirst
(
"(?i)^.*filename=\"([^\"]+)\".*$"
,
"$1"
));
}
}
/**
/**
* Reads the contents of a File to a String.
* Reads the contents of a File to a String.
*
*
* @param file the File instance to read the contents from
* @param file the File instance to read the contents from
* @return the contents of file as a String
* @return the contents of file as a String
* @throws IOException if any errors occur while opening or reading the file
* @throws IOException if any errors occur while opening or reading the file
...
@@ -79,7 +79,7 @@ public class FileUtils {
...
@@ -79,7 +79,7 @@ public class FileUtils {
try
(
Scanner
in
=
new
Scanner
(
file
))
{
try
(
Scanner
in
=
new
Scanner
(
file
))
{
in
.
useDelimiter
(
"\\Z"
);
in
.
useDelimiter
(
"\\Z"
);
return
(
in
.
next
());
return
(
in
.
next
());
}
}
}
}
/**
/**
...
...
src/main/java/org/gitlab4j/api/utils/HttpRequestUtils.java
View file @
0cb325a0
...
@@ -5,14 +5,14 @@ import java.io.InputStreamReader;
...
@@ -5,14 +5,14 @@ import java.io.InputStreamReader;
import
java.io.Reader
;
import
java.io.Reader
;
import
java.util.Enumeration
;
import
java.util.Enumeration
;
import
ja
vax
.servlet.http.Cookie
;
import
ja
karta
.servlet.http.Cookie
;
import
ja
vax
.servlet.http.HttpServletRequest
;
import
ja
karta
.servlet.http.HttpServletRequest
;
public
class
HttpRequestUtils
{
public
class
HttpRequestUtils
{
/**
/**
* Build a String containing a very short multi-line dump of an HTTP request.
* Build a String containing a very short multi-line dump of an HTTP request.
*
*
* @param fromMethod the method that this method was called from
* @param fromMethod the method that this method was called from
* @param request the HTTP request build the request dump from
* @param request the HTTP request build the request dump from
* @return a String containing a very short multi-line dump of the HTTP request
* @return a String containing a very short multi-line dump of the HTTP request
...
@@ -23,7 +23,7 @@ public class HttpRequestUtils {
...
@@ -23,7 +23,7 @@ public class HttpRequestUtils {
/**
/**
* Build a String containing a short multi-line dump of an HTTP request.
* Build a String containing a short multi-line dump of an HTTP request.
*
*
* @param fromMethod the method that this method was called from
* @param fromMethod the method that this method was called from
* @param request the HTTP request build the request dump from
* @param request the HTTP request build the request dump from
* @param includeHeaders if true will include the HTTP headers in the dump
* @param includeHeaders if true will include the HTTP headers in the dump
...
@@ -58,7 +58,7 @@ public class HttpRequestUtils {
...
@@ -58,7 +58,7 @@ public class HttpRequestUtils {
/**
/**
* Build a String containing a multi-line dump of an HTTP request.
* Build a String containing a multi-line dump of an HTTP request.
*
*
* @param fromMethod the method that this method was called from
* @param fromMethod the method that this method was called from
* @param request the HTTP request build the request dump from
* @param request the HTTP request build the request dump from
* @param includePostData if true will include the POST data in the dump
* @param includePostData if true will include the POST data in the dump
...
@@ -114,7 +114,7 @@ public class HttpRequestUtils {
...
@@ -114,7 +114,7 @@ public class HttpRequestUtils {
/**
/**
* Reads the POST data from a request into a String and returns it.
* Reads the POST data from a request into a String and returns it.
*
*
* @param request the HTTP request containing the POST data
* @param request the HTTP request containing the POST data
* @return the POST data as a String instance
* @return the POST data as a String instance
* @throws IOException if any error occurs while reading the POST data
* @throws IOException if any error occurs while reading the POST data
...
@@ -128,7 +128,7 @@ public class HttpRequestUtils {
...
@@ -128,7 +128,7 @@ public class HttpRequestUtils {
/**
/**
* Reads the content of a Reader instance and returns it as a String.
* Reads the content of a Reader instance and returns it as a String.
*
*
* @param reader the Reader instance to read the data from
* @param reader the Reader instance to read the data from
* @return the content of a Reader instance as a String
* @return the content of a Reader instance as a String
* @throws IOException if any error occurs while reading the POST data
* @throws IOException if any error occurs while reading the POST data
...
@@ -147,7 +147,7 @@ public class HttpRequestUtils {
...
@@ -147,7 +147,7 @@ public class HttpRequestUtils {
/**
/**
* Masks the PRIVATE-TOKEN header value with "********".
* Masks the PRIVATE-TOKEN header value with "********".
*
*
* @param s a String containing HTTP request info, usually logging info
* @param s a String containing HTTP request info, usually logging info
* @return a String with the PRIVATE-TOKEN header value masked with asterisks
* @return a String with the PRIVATE-TOKEN header value masked with asterisks
*/
*/
...
@@ -159,4 +159,4 @@ public class HttpRequestUtils {
...
@@ -159,4 +159,4 @@ public class HttpRequestUtils {
return
(
s
.
replaceAll
(
"PRIVATE\\-TOKEN\\: [\\S]*"
,
"PRIVATE-TOKEN: ********"
));
return
(
s
.
replaceAll
(
"PRIVATE\\-TOKEN\\: [\\S]*"
,
"PRIVATE-TOKEN: ********"
));
}
}
}
}
\ No newline at end of file
src/main/java/org/gitlab4j/api/utils/JacksonJson.java
View file @
0cb325a0
...
@@ -11,9 +11,9 @@ import java.util.List;
...
@@ -11,9 +11,9 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.TimeZone
;
import
java.util.TimeZone
;
import
ja
vax
.ws.rs.Produces
;
import
ja
karta
.ws.rs.Produces
;
import
ja
vax
.ws.rs.core.MediaType
;
import
ja
karta
.ws.rs.core.MediaType
;
import
ja
vax
.ws.rs.ext.ContextResolver
;
import
ja
karta
.ws.rs.ext.ContextResolver
;
import
org.gitlab4j.api.models.User
;
import
org.gitlab4j.api.models.User
;
import
org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJaxbJsonProvider
;
import
org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJaxbJsonProvider
;
...
@@ -81,7 +81,7 @@ public class JacksonJson extends JacksonJaxbJsonProvider implements ContextResol
...
@@ -81,7 +81,7 @@ public class JacksonJson extends JacksonJaxbJsonProvider implements ContextResol
/**
/**
* Gets the ObjectMapper contained by this instance.
* Gets the ObjectMapper contained by this instance.
*
*
* @return the ObjectMapper contained by this instance
* @return the ObjectMapper contained by this instance
*/
*/
public
ObjectMapper
getObjectMapper
()
{
public
ObjectMapper
getObjectMapper
()
{
...
@@ -230,7 +230,7 @@ public class JacksonJson extends JacksonJaxbJsonProvider implements ContextResol
...
@@ -230,7 +230,7 @@ public class JacksonJson extends JacksonJaxbJsonProvider implements ContextResol
/**
/**
* Marshals the supplied object out as a formatted JSON string.
* Marshals the supplied object out as a formatted JSON string.
*
*
* @param <T> the generics type for the provided object
* @param <T> the generics type for the provided object
* @param object the object to output as a JSON string
* @param object the object to output as a JSON string
* @return a String containing the JSON for the specified object
* @return a String containing the JSON for the specified object
...
...
src/main/java/org/gitlab4j/api/utils/MaskingLoggingFilter.java
View file @
0cb325a0
...
@@ -19,16 +19,16 @@ import java.util.concurrent.atomic.AtomicLong;
...
@@ -19,16 +19,16 @@ import java.util.concurrent.atomic.AtomicLong;
import
java.util.logging.Level
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
java.util.logging.Logger
;
import
ja
vax
.annotation.Priority
;
import
ja
karta
.annotation.Priority
;
import
ja
vax
.ws.rs.WebApplicationException
;
import
ja
karta
.ws.rs.WebApplicationException
;
import
ja
vax
.ws.rs.client.ClientRequestContext
;
import
ja
karta
.ws.rs.client.ClientRequestContext
;
import
ja
vax
.ws.rs.client.ClientRequestFilter
;
import
ja
karta
.ws.rs.client.ClientRequestFilter
;
import
ja
vax
.ws.rs.client.ClientResponseContext
;
import
ja
karta
.ws.rs.client.ClientResponseContext
;
import
ja
vax
.ws.rs.client.ClientResponseFilter
;
import
ja
karta
.ws.rs.client.ClientResponseFilter
;
import
ja
vax
.ws.rs.core.MediaType
;
import
ja
karta
.ws.rs.core.MediaType
;
import
ja
vax
.ws.rs.core.MultivaluedMap
;
import
ja
karta
.ws.rs.core.MultivaluedMap
;
import
ja
vax
.ws.rs.ext.WriterInterceptor
;
import
ja
karta
.ws.rs.ext.WriterInterceptor
;
import
ja
vax
.ws.rs.ext.WriterInterceptorContext
;
import
ja
karta
.ws.rs.ext.WriterInterceptorContext
;
import
org.glassfish.jersey.message.MessageUtils
;
import
org.glassfish.jersey.message.MessageUtils
;
...
@@ -46,21 +46,21 @@ public class MaskingLoggingFilter implements ClientRequestFilter, ClientResponse
...
@@ -46,21 +46,21 @@ public class MaskingLoggingFilter implements ClientRequestFilter, ClientResponse
/**
/**
* Default list of header names that should be masked.
* Default list of header names that should be masked.
*/
*/
public
static
final
List
<
String
>
DEFAULT_MASKED_HEADER_NAMES
=
public
static
final
List
<
String
>
DEFAULT_MASKED_HEADER_NAMES
=
Collections
.
unmodifiableList
(
Arrays
.
asList
(
"PRIVATE-TOKEN"
,
"Authorization"
,
"Proxy-Authorization"
));
Collections
.
unmodifiableList
(
Arrays
.
asList
(
"PRIVATE-TOKEN"
,
"Authorization"
,
"Proxy-Authorization"
));
/**
/**
* Prefix for request log entries.
* Prefix for request log entries.
*/
*/
protected
static
final
String
REQUEST_PREFIX
=
"> "
;
protected
static
final
String
REQUEST_PREFIX
=
"> "
;
/**
/**
* Prefix for response log entries.
* Prefix for response log entries.
*/
*/
protected
static
final
String
RESPONSE_PREFIX
=
"< "
;
protected
static
final
String
RESPONSE_PREFIX
=
"< "
;
/**
/**
* Prefix that marks the beginning of a request or response section.
* Prefix that marks the beginning of a request or response section.
*/
*/
protected
static
final
String
SECTION_PREFIX
=
"- "
;
protected
static
final
String
SECTION_PREFIX
=
"- "
;
...
@@ -202,7 +202,7 @@ public class MaskingLoggingFilter implements ClientRequestFilter, ClientResponse
...
@@ -202,7 +202,7 @@ public class MaskingLoggingFilter implements ClientRequestFilter, ClientResponse
/**
/**
* Logs each of the HTTP headers, masking the value of the header if the header key is
* Logs each of the HTTP headers, masking the value of the header if the header key is
* in the list of masked header names.
* in the list of masked header names.
*
*
* @param sb the StringBuilder to build up the logging info in
* @param sb the StringBuilder to build up the logging info in
* @param id the ID for the logging line
* @param id the ID for the logging line
* @param prefix the logging line prefix character
* @param prefix the logging line prefix character
...
@@ -212,7 +212,7 @@ public class MaskingLoggingFilter implements ClientRequestFilter, ClientResponse
...
@@ -212,7 +212,7 @@ public class MaskingLoggingFilter implements ClientRequestFilter, ClientResponse
final
long
id
,
final
long
id
,
final
String
prefix
,
final
String
prefix
,
final
MultivaluedMap
<
String
,
String
>
headers
)
{
final
MultivaluedMap
<
String
,
String
>
headers
)
{
getSortedHeaders
(
headers
.
entrySet
()).
forEach
(
h
->
{
getSortedHeaders
(
headers
.
entrySet
()).
forEach
(
h
->
{
final
List
<?>
values
=
h
.
getValue
();
final
List
<?>
values
=
h
.
getValue
();
...
@@ -223,7 +223,7 @@ public class MaskingLoggingFilter implements ClientRequestFilter, ClientResponse
...
@@ -223,7 +223,7 @@ public class MaskingLoggingFilter implements ClientRequestFilter, ClientResponse
String
value
=
(
isMaskedHeader
?
"********"
:
values
.
get
(
0
).
toString
());
String
value
=
(
isMaskedHeader
?
"********"
:
values
.
get
(
0
).
toString
());
appendId
(
sb
,
id
).
append
(
prefix
).
append
(
header
).
append
(
": "
).
append
(
value
).
append
(
'\n'
);
appendId
(
sb
,
id
).
append
(
prefix
).
append
(
header
).
append
(
": "
).
append
(
value
).
append
(
'\n'
);
}
else
{
}
else
{
final
StringBuilder
headerBuf
=
new
StringBuilder
();
final
StringBuilder
headerBuf
=
new
StringBuilder
();
for
(
final
Object
value
:
values
)
{
for
(
final
Object
value
:
values
)
{
if
(
headerBuf
.
length
()
==
0
)
{
if
(
headerBuf
.
length
()
==
0
)
{
...
@@ -232,12 +232,12 @@ public class MaskingLoggingFilter implements ClientRequestFilter, ClientResponse
...
@@ -232,12 +232,12 @@ public class MaskingLoggingFilter implements ClientRequestFilter, ClientResponse
headerBuf
.
append
(
isMaskedHeader
?
"********"
:
value
.
toString
());
headerBuf
.
append
(
isMaskedHeader
?
"********"
:
value
.
toString
());
}
}
appendId
(
sb
,
id
).
append
(
prefix
).
append
(
header
).
append
(
": "
).
append
(
headerBuf
.
toString
()).
append
(
'\n'
);
appendId
(
sb
,
id
).
append
(
prefix
).
append
(
header
).
append
(
": "
).
append
(
headerBuf
.
toString
()).
append
(
'\n'
);
}
}
});
});
}
}
protected
void
buildEntityLogString
(
StringBuilder
sb
,
byte
[]
entity
,
int
entitySize
,
Charset
charset
)
{
protected
void
buildEntityLogString
(
StringBuilder
sb
,
byte
[]
entity
,
int
entitySize
,
Charset
charset
)
{
sb
.
append
(
new
String
(
entity
,
0
,
Math
.
min
(
entitySize
,
maxEntitySize
),
charset
));
sb
.
append
(
new
String
(
entity
,
0
,
Math
.
min
(
entitySize
,
maxEntitySize
),
charset
));
...
@@ -302,9 +302,9 @@ public class MaskingLoggingFilter implements ClientRequestFilter, ClientResponse
...
@@ -302,9 +302,9 @@ public class MaskingLoggingFilter implements ClientRequestFilter, ClientResponse
final
StringBuilder
sb
=
new
StringBuilder
();
final
StringBuilder
sb
=
new
StringBuilder
();
printResponseLine
(
sb
,
"Received server response"
,
id
,
responseContext
.
getStatus
());
printResponseLine
(
sb
,
"Received server response"
,
id
,
responseContext
.
getStatus
());
printHeaders
(
sb
,
id
,
RESPONSE_PREFIX
,
responseContext
.
getHeaders
());
printHeaders
(
sb
,
id
,
RESPONSE_PREFIX
,
responseContext
.
getHeaders
());
if
(
responseContext
.
hasEntity
()
&&
maxEntitySize
>
0
)
{
if
(
responseContext
.
hasEntity
()
&&
maxEntitySize
>
0
)
{
responseContext
.
setEntityStream
(
logResponseEntity
(
sb
,
responseContext
.
getEntityStream
(),
responseContext
.
setEntityStream
(
logResponseEntity
(
sb
,
responseContext
.
getEntityStream
(),
MessageUtils
.
getCharset
(
responseContext
.
getMediaType
())));
MessageUtils
.
getCharset
(
responseContext
.
getMediaType
())));
}
}
...
@@ -319,7 +319,7 @@ public class MaskingLoggingFilter implements ClientRequestFilter, ClientResponse
...
@@ -319,7 +319,7 @@ public class MaskingLoggingFilter implements ClientRequestFilter, ClientResponse
if
(
stream
==
null
)
{
if
(
stream
==
null
)
{
return
;
return
;
}
}
MediaType
mediaType
=
context
.
getMediaType
();
MediaType
mediaType
=
context
.
getMediaType
();
if
(
mediaType
.
isCompatible
(
MediaType
.
APPLICATION_JSON_TYPE
)
||
if
(
mediaType
.
isCompatible
(
MediaType
.
APPLICATION_JSON_TYPE
)
||
mediaType
.
isCompatible
(
MediaType
.
APPLICATION_FORM_URLENCODED_TYPE
))
{
mediaType
.
isCompatible
(
MediaType
.
APPLICATION_FORM_URLENCODED_TYPE
))
{
...
...
src/main/java/org/gitlab4j/api/utils/Oauth2LoginStreamingOutput.java
View file @
0cb325a0
package
org.gitlab4j.api.utils
;
package
org.gitlab4j.api.utils
;
import
jakarta.ws.rs.WebApplicationException
;
import
jakarta.ws.rs.core.StreamingOutput
;
import
java.io.BufferedWriter
;
import
java.io.BufferedWriter
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.io.OutputStream
;
...
@@ -7,9 +10,6 @@ import java.io.OutputStreamWriter;
...
@@ -7,9 +10,6 @@ import java.io.OutputStreamWriter;
import
java.io.Writer
;
import
java.io.Writer
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
javax.ws.rs.WebApplicationException
;
import
javax.ws.rs.core.StreamingOutput
;
/**
/**
* This StreamingOutput implementation is utilized to send a OAuth2 token request
* This StreamingOutput implementation is utilized to send a OAuth2 token request
* in a secure manner. The password is never copied to a String, instead it is
* in a secure manner. The password is never copied to a String, instead it is
...
@@ -75,4 +75,4 @@ public class Oauth2LoginStreamingOutput implements StreamingOutput, AutoCloseabl
...
@@ -75,4 +75,4 @@ public class Oauth2LoginStreamingOutput implements StreamingOutput, AutoCloseabl
clearPassword
();
clearPassword
();
super
.
finalize
();
super
.
finalize
();
}
}
}
}
\ No newline at end of file
src/main/java/org/gitlab4j/api/webhook/WebHookManager.java
View file @
0cb325a0
...
@@ -7,7 +7,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
...
@@ -7,7 +7,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import
java.util.logging.Level
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
java.util.logging.Logger
;
import
ja
vax
.servlet.http.HttpServletRequest
;
import
ja
karta
.servlet.http.HttpServletRequest
;
import
org.gitlab4j.api.GitLabApiException
;
import
org.gitlab4j.api.GitLabApiException
;
import
org.gitlab4j.api.HookManager
;
import
org.gitlab4j.api.HookManager
;
...
...
Prev
1
2
3
4
Next
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