use of com.microsoft.tooling.msservices.helpers.azure.rest.RestServiceManager.ContentType in project azure-tools-for-java by Microsoft.
the class AzureAADHelper method getHttpsURLConnectionProvider.
@NotNull
private static HttpsURLConnectionProvider getHttpsURLConnectionProvider(@NotNull final String accessToken, @NotNull final RestServiceManager manager) {
return new HttpsURLConnectionProvider() {
@Override
@NotNull
public HttpsURLConnection getSSLConnection(@NotNull String managementUrl, @NotNull String path, @NotNull ContentType contentType) throws AzureCmdException {
HttpsURLConnection sslConnection = manager.getSSLConnection(managementUrl, path, contentType);
sslConnection.addRequestProperty(AUTHORIZATION_HEADER, "Bearer " + accessToken);
return sslConnection;
}
};
}
use of com.microsoft.tooling.msservices.helpers.azure.rest.RestServiceManager.ContentType in project azure-tools-for-java by Microsoft.
the class AzureCertificateHelper method getHttpsURLConnectionProvider.
@NotNull
private static HttpsURLConnectionProvider getHttpsURLConnectionProvider(@NotNull final SSLSocketFactory sslSocketFactory, @NotNull final RestServiceManager manager) {
return new HttpsURLConnectionProvider() {
@Override
@NotNull
public HttpsURLConnection getSSLConnection(@NotNull String managementUrl, @NotNull String path, @NotNull ContentType contentType) throws AzureCmdException {
HttpsURLConnection sslConnection = manager.getSSLConnection(managementUrl, path, contentType);
sslConnection.setSSLSocketFactory(sslSocketFactory);
return sslConnection;
}
};
}
Aggregations