mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-23 16:05:09 +00:00
changed: deprecation code
This commit is contained in:
parent
f23007515a
commit
1c1bea090d
@ -3,6 +3,8 @@ package stirling.software.SPDF.model;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -131,19 +133,20 @@ public class ApplicationProperties {
|
|||||||
private String privateKey;
|
private String privateKey;
|
||||||
private String spCert;
|
private String spCert;
|
||||||
|
|
||||||
private String entityId;
|
|
||||||
private String spBaseUrl;
|
|
||||||
private String idpMetadataLocation;
|
|
||||||
|
|
||||||
public InputStream getIdpMetadataUri() throws IOException {
|
public InputStream getIdpMetadataUri() throws IOException {
|
||||||
if (idpMetadataUri.startsWith("classpath:")) {
|
if (idpMetadataUri.startsWith("classpath:")) {
|
||||||
return new ClassPathResource(idpMetadataUri.substring("classpath".length()))
|
return new ClassPathResource(idpMetadataUri.substring("classpath".length()))
|
||||||
.getInputStream();
|
.getInputStream();
|
||||||
}
|
}
|
||||||
URL url = new URL(idpMetadataUri);
|
try {
|
||||||
|
URI uri = new URI(idpMetadataUri);
|
||||||
|
URL url = uri.toURL();
|
||||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||||
connection.setRequestMethod("GET");
|
connection.setRequestMethod("GET");
|
||||||
return connection.getInputStream();
|
return connection.getInputStream();
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
throw new IOException("Invalid URI format: " + idpMetadataUri, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Resource getSpCert() {
|
public Resource getSpCert() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user