Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F82216028
JerseyHttpClientTool.scala
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Sep 10, 05:31
Size
1 KB
Mime Type
text/x-c
Expires
Thu, Sep 12, 05:31 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20667243
Attached To
R2664 SHRINE MedCo Fork
JerseyHttpClientTool.scala
View Options
package
net.shrine.utilities.jerseyhttpclienttool
import
com.typesafe.config.ConfigFactory
import
net.shrine.client.
{
EndpointConfig
,
JerseyHttpClient
}
import
net.shrine.crypto.
{
BouncyKeyStoreCollection
,
KeyStoreDescriptorParser
}
import
net.shrine.config.ConfigExtensions
import
scala.util.control.NonFatal
/**
* @author dwalend
* @since 1.22.5
*/
object
JerseyHttpClientTool
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
config
=
ConfigFactory
.
load
()
println
(
config
)
val
shrineConfig
=
config
.
getConfig
(
"shrine"
)
val
qepConfig
=
shrineConfig
.
getConfig
(
"queryEntryPoint"
)
val
endpoint
=
EndpointConfig
(
qepConfig
.
getConfig
(
"broadcasterServiceEndpoint"
))
lazy
val
keyStoreDescriptor
=
KeyStoreDescriptorParser
(
shrineConfig
.
getConfig
(
"keystore"
),
shrineConfig
.
getConfigOrEmpty
(
"hub"
),
shrineConfig
.
getConfigOrEmpty
(
"queryEntryPoint"
))
val
certCollection
:
BouncyKeyStoreCollection
=
BouncyKeyStoreCollection
.
fromFileRecoverWithClassPath
(
keyStoreDescriptor
)
val
httpClient
=
JerseyHttpClient
(
certCollection
,
endpoint
)
try
{
httpClient
.
post
(
s
"test"
,
endpoint
.
url
.
toString
)
}
catch
{
case
NonFatal
(
x
)
=>
x
.
printStackTrace
()
}
}
}
Event Timeline
Log In to Comment