Skip to content

Commit

Permalink
fixed deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
albogdano committed Nov 27, 2024
1 parent 4ecd435 commit 73a3fd6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import com.erudika.para.core.App;
import com.erudika.para.core.utils.Para;
import com.erudika.para.server.rest.RestUtils;
import java.io.IOException;
import java.util.Set;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.DefaultRedirectStrategy;
Expand Down Expand Up @@ -58,10 +58,10 @@ public void onAuthenticationFailure(HttpServletRequest request, HttpServletRespo
}
if (!StringUtils.isBlank(hostUrlParam)) {
if (hostUrlAliases.contains(hostUrlParam) || StringUtils.startsWith(customURI, hostUrlParam)) {
UriComponents hostUrl = UriComponentsBuilder.fromHttpUrl(hostUrlParam).build();
customURI = UriComponentsBuilder.fromHttpUrl(customURI).host(hostUrl.getHost()).toUriString();
UriComponents hostUrl = UriComponentsBuilder.fromUriString(hostUrlParam).build();
customURI = UriComponentsBuilder.fromUriString(customURI).host(hostUrl.getHost()).toUriString();
} else {
UriComponents customHost = UriComponentsBuilder.fromHttpUrl(customURI).build();
UriComponents customHost = UriComponentsBuilder.fromUriString(customURI).build();
customURI = customHost.getScheme() + "://" + customHost.getHost();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
import com.erudika.para.server.rest.RestUtils;
import com.erudika.para.server.utils.HttpUtils;
import com.nimbusds.jwt.SignedJWT;
import java.io.IOException;
import java.util.Set;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.DefaultRedirectStrategy;
Expand Down Expand Up @@ -64,10 +64,10 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
}
if (!StringUtils.isBlank(hostUrlParam)) {
if (hostUrlAliases.contains(hostUrlParam) || StringUtils.startsWith(customURI, hostUrlParam)) {
UriComponents hostUrl = UriComponentsBuilder.fromHttpUrl(hostUrlParam).build();
customURI = UriComponentsBuilder.fromHttpUrl(customURI).host(hostUrl.getHost()).toUriString();
UriComponents hostUrl = UriComponentsBuilder.fromUriString(hostUrlParam).build();
customURI = UriComponentsBuilder.fromUriString(customURI).host(hostUrl.getHost()).toUriString();
} else {
UriComponents customHost = UriComponentsBuilder.fromHttpUrl(customURI).build();
UriComponents customHost = UriComponentsBuilder.fromUriString(customURI).build();
customURI = customHost.getScheme() + "://" + customHost.getHost();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
*/
package com.erudika.para.utils.filters;

import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
Expand All @@ -23,10 +26,6 @@
import java.util.List;
import java.util.Locale;

import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletResponse;

@SuppressWarnings("unchecked")
public class MockHttpServletResponse implements HttpServletResponse {
List headerNames = new ArrayList();
Expand Down Expand Up @@ -209,4 +208,9 @@ public void setContentLengthLong(long len) {
throw new UnsupportedOperationException("Not supported yet.");
}

@Override
public void sendRedirect(String string, int i, boolean bln) throws IOException {
throw new UnsupportedOperationException("Not supported yet.");
}

}
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
<jerseyVer>3.1.6</jerseyVer>
<springBootVer>3.4.0</springBootVer>
<metricsVer>4.2.25</metricsVer>
<httpClientVer>5.3.1</httpClientVer>
<httpCoreVer>5.2.4</httpCoreVer>
<httpClientVer>5.4.1</httpClientVer>
<httpCoreVer>5.3.1</httpCoreVer>
<commonsCodecVer>1.16.1</commonsCodecVer>
<lucenePluginVer>1.49.2</lucenePluginVer>
<sqlPluginVer>1.49.0</sqlPluginVer>
Expand Down

0 comments on commit 73a3fd6

Please sign in to comment.